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-unnecessary-type-arguments] throws #1076

Closed
fabiospampinato opened this issue Oct 13, 2019 · 1 comment · Fixed by #1217
Closed

[no-unnecessary-type-arguments] throws #1076

fabiospampinato opened this issue Oct 13, 2019 · 1 comment · Fixed by #1217
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

@fabiospampinato
Copy link

fabiospampinato commented Oct 13, 2019

Repro

{
  "rules": {
	"@typescript-eslint/no-unnecessary-type-arguments": "error"
  }
}
type SveltoWidgetRef<T> = import ( 'react' ).RefObject<T>;

Expected Result

It shouldn't throw.

Actual Result

It throws.

Additional Info

This is the error:

Error: Debug Failure. Branch in 'resolveSignature' should be unreachable. SyntaxKind: ImportType
Occurred while linting /Users/fabio/Projects/notable/src/types.d.ts:434
    at resolveSignature (/Users/fabio/Projects/notable/node_modules/typescript/lib/typescript.js:52930:28)
    at getResolvedSignature (/Users/fabio/Projects/notable/node_modules/typescript/lib/typescript.js:52950:26)
    at getResolvedSignatureWorker (/Users/fabio/Projects/notable/node_modules/typescript/lib/typescript.js:32457:30)
    at Object.getResolvedSignature (/Users/fabio/Projects/notable/node_modules/typescript/lib/typescript.js:32320:24)
    at getTypeParametersFromCall (/Users/fabio/Projects/notable/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js:100:25)
    at getTypeParametersFromNode (/Users/fabio/Projects/notable/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js:82:12)
    at getArgsAndParameters (/Users/fabio/Projects/notable/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js:70:28)
    at TSTypeParameterInstantiation (/Users/fabio/Projects/notable/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unnecessary-type-arguments.js:61:39)
    at listeners.(anonymous function).forEach.listener (/Users/fabio/Projects/notable/node_modules/eslint/lib/linter/safe-emitter.js:45:58)
    at Array.forEach (<anonymous>)

Debug Dump

// lots of other lines about other files before this
  eslint:ignored-paths contains: +81ms
  eslint:ignored-paths   target   = "/Users/fabio/Projects/notable/src/types.d.ts" +0ms
  eslint:ignored-paths   base     = "/Users/fabio/Projects/notable" +0ms
  eslint:ignored-paths   relative = "src/types.d.ts" +0ms
  eslint:ignored-paths   result   = false +0ms
  eslint:file-enumerator Yield: types.d.ts +0ms
  eslint:cli-engine Lint /Users/fabio/Projects/notable/src/types.d.ts +81ms
  eslint:linter Linting code for /Users/fabio/Projects/notable/src/types.d.ts (pass 1) +1ms
  eslint:linter Verify +1ms
  eslint:linter With ConfigArray: /Users/fabio/Projects/notable/src/types.d.ts +1ms
  eslint:linter An error occurred while traversing +80ms
  eslint:linter Filename: /Users/fabio/Projects/notable/src/types.d.ts +0ms
  eslint:linter Line: 434 +0ms
  eslint:linter Parser Options: { ecmaVersion: 11,
  ecmaFeatures: { globalReturn: false, jsx: true },
  project: 'tsconfig.json',
  sourceType: 'module',
  useJSXTextNode: true } +0ms
  eslint:linter Parser Path: /Users/fabio/Projects/notable/node_modules/@typescript-eslint/parser/dist/parser.js +2ms
  eslint:linter Settings: { react: { pragma: 'React', version: 'detect' } } +0ms
Debug Failure. Branch in 'resolveSignature' should be unreachable. SyntaxKind: ImportType
Occurred while linting /Users/fabio/Projects/notable/src/types.d.ts:434

Versions

package version
@typescript-eslint/eslint-plugin 2.3.4-alpha.5
@typescript-eslint/parser 2.3.3
TypeScript 3.6.4
ESLint 6.5.1
node 10.15.0
npm 6.4.1
@fabiospampinato fabiospampinato added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Oct 13, 2019
@fabiospampinato fabiospampinato changed the title [no-unnecessary-type-arguments [no-unnecessary-type-arguments] throws Oct 13, 2019
@bradzacher bradzacher removed the triage Waiting for maintainers to take a look label Oct 13, 2019
@glen-84
Copy link
Contributor

glen-84 commented Nov 14, 2019

@bradzacher Can this be labelled as a bug?

@bradzacher bradzacher added the bug Something isn't working label Nov 14, 2019
@bradzacher bradzacher added the has pr there is a PR raised to close this label Nov 17, 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
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
Development

Successfully merging a pull request may close this issue.

3 participants