Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

no-unused-vars breaks when destructuring an argument after applying a decorator #297

Closed
Labels
package: eslint-pluginIssues related to @typescript-eslint/eslint-plugintriageWaiting for team members to take a look
@rfermann

Description

@rfermann

What code were you trying to parse?

I try to lint the following code:

asyncsomething(@Arg(){ email}:SomeInput):Promise<boolean>{}

The linting crashes with the stack trace listed under "What actually happened?".

Changing the code to:

asyncsomething(@Arg()input:SomeInput):Promise<boolean>{}

makes the rule run fine.

I created a repo for easier reproduction:https://github.com/rfermann/args-decorator-parser-error.

What did you expect to happen?
I expect to not get aTypeError during linting

What actually happened?
I got aTypeError during linting:

eslint index.ts

TypeError: Cannot read property 'type' of undefined
at isForInRef (C:\Users\parser-issue\node_modules\eslint\lib\rules\no-unused-vars.js:434:24)
at variable.references.some.ref (C:\Users\parser-issue\node_modules\eslint\lib\rules\no-unused-vars.js:471:21)
at Array.some ()
at isUsedVariable (C:\Users\parser-issue\node_modules\eslint\lib\rules\no-unused-vars.js:470:40)
at collectUnusedVariables (C:\Users\parser-issue\node_modules\eslint\lib\rules\no-unused-vars.js:582:26)
at collectUnusedVariables (C:\Users\parser-issue\node_modules\eslint\lib\rules\no-unused-vars.js:589:17)
at Program:exit (C:\Users\parser-issue\node_modules\eslint\lib\rules\no-unused-vars.js:634:36)
at listeners.(anonymous function).forEach.listener (C:\Users\parser-issue\node_modules\eslint\lib\util\safe-emitter.js:45:58)
at Array.forEach ()
at Object.emit (C:\Users\parser-issue\node_modules\eslint\lib\util\safe-emitter.js:45:38)
Versions

packageversion
@typescript-eslint/parser1.3.0
TypeScript3.3.1
ESLint5.14.1
node10.11.0
npm6.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: eslint-pluginIssues related to @typescript-eslint/eslint-plugintriageWaiting for team members to take a look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp