-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed as not planned
Closed as not planned
Copy link
Labels
bugSomething isn't workingSomething isn't workingfix: user errorissue was fixed by correcting the configuration / correcting the codeissue was fixed by correcting the configuration / correcting the codepackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-pluginvueissues relating to vue supportissues relating to vue support
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
https://codesandbox.io/p/devbox/delicate-platform-64cd72
Repro Code
error reported when vue files have no `<script lang="ts">` block defined.
npm run lint
ESLint Config
module.exports = {
root: true,
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
],
parserOptions: {
project: ["./tsconfig.json", "./tsconfig.node.json"],
},
overrides: [
{
files: ["*.vue"],
extends: [
"plugin:@typescript-eslint/disable-type-checked",
"plugin:vue/vue3-recommended",
],
},
],
};
tsconfig
Expected Result
No error report
Actual Result
Error: Error while loading rule '@typescript-eslint/consistent-type-assertions': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.
Occurred while linting /workspaces/workspace/src/App.vue
at getParserServices (/workspaces/workspace/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js:21:15)
at create (/workspaces/workspace/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-assertions.js:90:61)
at Object.create (/workspaces/workspace/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js:38:20)
at createRuleListeners (/workspaces/workspace/node_modules/eslint/lib/linter/linter.js:895:21)
at /workspaces/workspace/node_modules/eslint/lib/linter/linter.js:1066:110
at Array.forEach (<anonymous>)
at runRules (/workspaces/workspace/node_modules/eslint/lib/linter/linter.js:1003:34)
at Linter._verifyWithoutProcessors (/workspaces/workspace/node_modules/eslint/lib/linter/linter.js:1355:31)
at /workspaces/workspace/node_modules/eslint/lib/linter/linter.js:1913:29
at Array.map (<anonymous>)
Additional Info
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfix: user errorissue was fixed by correcting the configuration / correcting the codeissue was fixed by correcting the configuration / correcting the codepackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-pluginvueissues relating to vue supportissues relating to vue support