Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[no-unnecessary-type-arguments] TypeError when Symbol is not defined #1006

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

Closed
quentin-jaquier-sonarsource opened this issue Sep 24, 2019 · 0 comments · Fixed by #1007
Closed
Labels
bug Something isn't working has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@quentin-jaquier-sonarsource
Copy link
Contributor

Repro

{
  "rules": {
    "@typescript-eslint/no-unnecessary-type-arguments": ["error"]
  }
}
  let a: A<number>;

Expected Result

No error.

Actual Result

TypeError preventing the whole analysis.

TypeError: Cannot read property 'flags' of undefined
Occurred while linting C:\TEMPS\test\simple.ts:3
    at Object.isFlagSet (C:\TEMPS\test\node_modules\tsutils\util\util.js:66:17)
    at getAliasedSymbol (C:\TEMPS\test\node_modules\@typescript-eslint\eslint-plugin\dist\rules\no-unnecessary-type-arguments.js:106:20)
    at getTypeParametersFromType (C:\TEMPS\test\node_modules\@typescript-eslint\eslint-plugin\dist\rules\no-unnecessary-type-arguments.js:85:17)
    at getTypeParametersFromNode (C:\TEMPS\test\node_modules\@typescript-eslint\eslint-plugin\dist\rules\no-unnecessary-type-arguments.js:80:16)
    at getArgsAndParameters (C:\TEMPS\test\node_modules\@typescript-eslint\eslint-plugin\dist\rules\no-unnecessary-type-arguments.js:70:28)
    at TSTypeParameterInstantiation (C:\TEMPS\test\node_modules\@typescript-eslint\eslint-plugin\dist\rules\no-unnecessary-type-arguments.js:61:39)
    at listeners.(anonymous function).forEach.listener (C:\TEMPS\test\node_modules\eslint\lib\linter\safe-emitter.js:45:58)
    at Array.forEach (<anonymous>)
    at Object.emit (C:\TEMPS\test\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
    at NodeEventGenerator.applySelector (C:\TEMPS\test\node_modules\eslint\lib\linter\node-event-generator.js:253:26)

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
@quentin-jaquier-sonarsource quentin-jaquier-sonarsource added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Sep 24, 2019
@quentin-jaquier-sonarsource quentin-jaquier-sonarsource changed the title [no-unnecessary-type-arguments] TypeError when Symbol is unknown [no-unnecessary-type-arguments] TypeError when Symbol is not defined Sep 24, 2019
@bradzacher bradzacher added bug Something isn't working has pr there is a PR raised to close this and removed triage Waiting for team members to take a look labels Sep 24, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 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 has pr there is a PR raised to close this package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
2 participants