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

False positives for no-unnecessary-type-assertion #187

Closed
armano2 opened this issue Feb 1, 2019 · 0 comments · Fixed by #226
Closed

False positives for no-unnecessary-type-assertion #187

armano2 opened this issue Feb 1, 2019 · 0 comments · Fixed by #226
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@armano2
Copy link
Member

armano2 commented Feb 1, 2019

Repro

https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/typescript-estree/src/convert.ts#L450

{
  ...
  "rules": {
    "@typescript-eslint/no-unnecessary-type-assertion": "error",
    ...
  },
  "parserOptions": {
    "sourceType": "module",
    "project": [
      "./packages/typescript-estree/tsconfig.json",
      "./packages/parser/tsconfig.json",
      "./packages/eslint-plugin-tslint/tsconfig.json"
    ],
    "ecmaFeatures": {
      "jsx": false
    }
  },
  ...
}

Expected Result
there should not be error on (node as any).externalModuleIndicator

Actual Result

506:24  error  This assertion is unnecessary since it does not change the type of the expression  @typescript-eslint/no-unnecessary-type-assertion

Additional Info
i'm getting a lot of false positives in convert.ts

Versions

package version
@typescript-eslint/eslint-plugin master
@typescript-eslint/parser master
TypeScript ~3.2.1
ESLint ^5.12.1
node X.Y.Z
npm X.Y.Z
@armano2 armano2 added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Feb 1, 2019
@armano2 armano2 added bug Something isn't working and removed triage Waiting for team members to take a look labels Feb 1, 2019
@typescript-eslint typescript-eslint locked as resolved and limited conversation to collaborators Feb 21, 2020
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
1 participant