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] TypeError: context.report() called with a messageId, but no messages were present in the rule metadata. #2451

Closed
Labels
bugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@esetnik

Description

@esetnik
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I haveread the FAQ and my problem is not listed.

Repro

module.exports={extends:['react-app','eslint:recommended','plugin:@typescript-eslint/eslint-recommended','plugin:@typescript-eslint/recommended','plugin:prettier/recommended',],rules:{'@typescript-eslint/no-unused-vars':[1,{argsIgnorePattern:'^_'}],'@typescript-eslint/explicit-function-return-type':'off','no-restricted-imports':['error',{paths:[{name:'styled-components',message:'Please import from styled-components/macro.',},],patterns:['!styled-components/macro'],},],},};
// jest-styled-components.d.tsdeclarenamespacejest{interfaceMatchers<R>{toHaveStyleRule:import('jest-styled-components').jest.Matchers<R>['toHaveStyleRule'];}}
{"compilerOptions": {"target":"es5","lib": ["dom","dom.iterable","esnext"],"allowJs":true,"skipLibCheck":true,"esModuleInterop":true,"allowSyntheticDefaultImports":true,"strict":true,"forceConsistentCasingInFileNames":true,"module":"esnext","moduleResolution":"node","resolveJsonModule":true,"isolatedModules":true,"noEmit":true,"jsx":"react"  },"include": ["src","test"],"plugins": [    {"name":"typescript-styled-plugin"    }  ]}

Expected Result

No crash. The same configuration and file works fine in v3.10.1

Actual Result

After upgrading to v4.0.1

TypeError: context.report() called with a messageId, but no messages were present in the rule metadata.Occurred while linting /Users/redacted/frontend/src/types/jest-styled-components.d.ts:1    at /Users/redacted/frontend/node_modules/eslint/lib/linter/report-translator.js:317:23    at Object.report (/Users/redacted/frontend/node_modules/eslint/lib/linter/linter.js:905:41)    at TSModuleDeclaration (/Users/redacted/frontend/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js:124:33)    at /Users/redacted/frontend/node_modules/eslint/lib/linter/safe-emitter.js:45:58    at Array.forEach (<anonymous>)    at Object.emit (/Users/redacted/frontend/node_modules/eslint/lib/linter/safe-emitter.js:45:38)    at NodeEventGenerator.applySelector (/Users/redacted/frontend/node_modules/eslint/lib/linter/node-event-generator.js:254:26)    at NodeEventGenerator.applySelectors (/Users/redacted/frontend/node_modules/eslint/lib/linter/node-event-generator.js:283:22)    at NodeEventGenerator.enterNode (/Users/redacted/frontend/node_modules/eslint/lib/linter/node-event-generator.js:297:14)    at CodePathAnalyzer.enterNode (/Users/redacted/frontend/node_modules/eslint/lib/linter/code-path-analysis/code-path-analyzer.js:634:23)

Additional Info

typescript-eslint-debug.log

Versions

packageversion
@typescript-eslint/eslint-plugin4.0.1
@typescript-eslint/parser4.0.1
TypeScript4.0.2
ESLint6.8.0
node12.8.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp