Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(eslint-plugin): [prefer-readonly] correct issue with anonymus functions #4974

Merged
merged 4 commits into from May 23, 2022

Conversation

armano2
Copy link
Member

@armano2 armano2 commented May 14, 2022

PR Checklist

Overview

this seem like issue with types produced by typescript

for code typescript returns us IntersectionType without symbol instead of ObjectType

function ClassWithName<TBase extends new (...args: any[]) => {}>(Base: TBase) {
	return class extends Base {

		private _name: string;

		public test(value: string) {
			this._name = value;
		}
	}
}

in typeFlags we are receiving Intersection = 2097152 instead of Object = 524288, we can simply fix it by adding handling to this case,

microsoft/TypeScript#49116

@armano2 armano2 added bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin labels May 14, 2022
@nx-cloud
Copy link

nx-cloud bot commented May 14, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 490db56. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 47 targets

Sent with 💌 from NxCloud.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @armano2!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@netlify
Copy link

netlify bot commented May 14, 2022

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 490db56
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/62854edb77ae9a00091dbfb1
😎 Deploy Preview https://deploy-preview-4974--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@codecov
Copy link

codecov bot commented May 14, 2022

Codecov Report

Merging #4974 (490db56) into main (08ae2c4) will increase coverage by 2.46%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #4974      +/-   ##
==========================================
+ Coverage   91.32%   93.79%   +2.46%     
==========================================
  Files         132      286     +154     
  Lines        1487     9797    +8310     
  Branches      224     2931    +2707     
==========================================
+ Hits         1358     9189    +7831     
- Misses         65      328     +263     
- Partials       64      280     +216     
Flag Coverage Δ
unittest 93.79% <100.00%> (+2.46%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ackages/eslint-plugin/src/rules/prefer-readonly.ts 99.08% <100.00%> (ø)
...ackages/eslint-plugin/src/rules/prefer-includes.ts 97.72% <0.00%> (ø)
...lugin/src/rules/consistent-indexed-object-style.ts 92.06% <0.00%> (ø)
...int-plugin/src/rules/prefer-literal-enum-member.ts 100.00% <0.00%> (ø)
...-plugin/src/rules/explicit-function-return-type.ts 100.00% <0.00%> (ø)
packages/eslint-plugin/src/util/objectIterators.ts 66.66% <0.00%> (ø)
...-plugin/src/rules/naming-convention-utils/index.ts 100.00% <0.00%> (ø)
packages/eslint-plugin/src/rules/no-unsafe-call.ts 100.00% <0.00%> (ø)
...slint-plugin/src/rules/no-unnecessary-qualifier.ts 100.00% <0.00%> (ø)
...nt-plugin/src/rules/indent-new-do-not-use/index.ts 98.09% <0.00%> (ø)
... and 145 more

@armano2 armano2 requested a review from bradzacher May 21, 2022 16:26
@bradzacher bradzacher merged commit 952e2f0 into main May 23, 2022
@bradzacher bradzacher deleted the fix/prefer-readonly-intersection-class-types-2590 branch May 23, 2022 16:16
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[prefer-readonly] False positive on fields within mixin classes
2 participants