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

[no-func-assign] Duplicates TypeScript's TS2539 error #983

Closed
OliverSieweke opened this issue Sep 17, 2019 · 2 comments · Fixed by #984
Closed

[no-func-assign] Duplicates TypeScript's TS2539 error #983

OliverSieweke opened this issue Sep 17, 2019 · 2 comments · Fixed by #984
Labels
breaking change This change will require a new major version to be released has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin recommended-rules Discussion about recommended rule sets

Comments

@OliverSieweke
Copy link
Contributor

Recommended ESLint rules that are already handled by TypeScript are turned off in plugin:@typescript-eslint/recommended.
The recommended no-func-assign rule should be included in the list as it triggers an ESLint as well as a TypeScript error.

Repro

{
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/eslint-recommended",
    "plugin:@typescript-eslint/recommended"
  ]
}
function foo() {}
foo = bar;

Expected Result

A simple TypeScript error for line 2:

  • TS2539: Cannot assign to 'foo' because it is not a variable.

Actual Result

A duplicate error for line 2, one coming from TypeScript the other one coming from ESLint:

  • TS2539: Cannot assign to 'foo' because it is not a variable.
  • ESLint: 'foo' is a function.(no-func-assign)

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 2.3.0
@typescript-eslint/parser 2.3.0
TypeScript 3.6.3
ESLint 6.4.0
node 10.16.3
npm 6.9.0
@OliverSieweke OliverSieweke added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Sep 17, 2019
OliverSieweke added a commit to OliverSieweke/typescript-eslint that referenced this issue Sep 17, 2019
@bradzacher bradzacher added breaking change This change will require a new major version to be released recommended-rules Discussion about recommended rule sets and removed triage Waiting for maintainers to take a look labels Sep 18, 2019
@bradzacher bradzacher added this to the 3.0.0 milestone Sep 18, 2019
@bradzacher bradzacher added the has pr there is a PR raised to close this label Sep 18, 2019
@bradzacher
Copy link
Member

Thanks for the suggestion!
I think it's a good idea to add this to the list.

We are unable to make changes to the recommended sets without a breaking change, so we'll leave this open for now - but I've added it to the list of things to get in with the 3.0 release.

@bradzacher
Copy link
Member

consolidated eslint-recommended changes in #1273

@bradzacher bradzacher removed this from the 3.0.0 milestone Dec 3, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking change This change will require a new major version to be released has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin recommended-rules Discussion about recommended rule sets
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants