You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm sure the problem is a parser problem. (If you are not sure, search for the issue in eslint-plugin-vue repo and open the issue in eslint-plugin-vue repo if there is no solution.
I have tried restarting my IDE and the issue persists.
I have updated to the latest version of the packages.
What version of ESLint are you using?
8.57.0
What version of eslint-plugin-vue and vue-eslint-parser are you using?
I expect @typescript-eslint/consistent-type-imports rule will work correctly. It requires providing project option for @typescript-eslint/parser. If I don't lint *.vue files it works correctly.
What actually happened?
I get error. I tried to fix it and understood that happens because of both languages linting enabled. When I change config to this:
Eslint works correctly(but ignores js written components by obviously reasons). I suppose @typescript-eslint/parser does not get value of project from parserOptions, when you configured config by the first way
Error: Error while loading rule '@typescript-eslint/consistent-type-imports': 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.
Parser: /home/dmitry/Templates/crm-frontend-v2/node_modules/vue-eslint-parser/index.js
Note: detected a parser other than @typescript-eslint/parser. Make sure the parser is configured to forward "parserOptions.project" to @typescript-eslint/parser.
Occurred while linting /home/dmitry/Templates/crm-frontend-v2/src/App.vue
at throwError (/home/dmitry/Templates/crm-frontend-v2/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js:40:11)
at getParserServices (/home/dmitry/Templates/crm-frontend-v2/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js:20:9)
at create (/home/dmitry/Templates/crm-frontend-v2/node_modules/@typescript-eslint/eslint-plugin/dist/rules/consistent-type-imports.js:85:68)
at Object.create (/home/dmitry/Templates/crm-frontend-v2/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js:38:20)
at createRuleListeners (/home/dmitry/Templates/crm-frontend-v2/node_modules/eslint/lib/linter/linter.js:895:21)
at /home/dmitry/Templates/crm-frontend-v2/node_modules/eslint/lib/linter/linter.js:1066:110
at Array.forEach (<anonymous>)
at runRules (/home/dmitry/Templates/crm-frontend-v2/node_modules/eslint/lib/linter/linter.js:1003:34)
at Linter._verifyWithoutProcessors (/home/dmitry/Templates/crm-frontend-v2/node_modules/eslint/lib/linter/linter.js:1355:31)
at /home/dmitry/Templates/crm-frontend-v2/node_modules/eslint/lib/linter/linter.js:1913:29
at Array.map (<anonymous>)
at Linter._verifyWithProcessor (/home/dmitry/Templates/crm-frontend-v2/node_modules/eslint/lib/linter/linter.js:1908:37)
at Linter._verifyWithConfigArray (/home/dmitry/Templates/crm-frontend-v2/node_modules/eslint/lib/linter/linter.js:1800:25)
at Linter.verify (/home/dmitry/Templates/crm-frontend-v2/node_modules/eslint/lib/linter/linter.js:1437:65)
at Linter.verifyAndFix (/home/dmitry/Templates/crm-frontend-v2/node_modules/eslint/lib/linter/linter.js:2068:29)
at verifyText (/home/dmitry/Templates/crm-frontend-v2/node_modules/eslint/lib/cli-engine/cli-engine.js:254:48)
at CLIEngine.executeOnFiles (/home/dmitry/Templates/crm-frontend-v2/node_modules/eslint/lib/cli-engine/cli-engine.js:834:28)
at ESLint.lintFiles (/home/dmitry/Templates/crm-frontend-v2/node_modules/eslint/lib/eslint/eslint.js:551:23)
at Object.execute (/home/dmitry/Templates/crm-frontend-v2/node_modules/eslint/lib/cli.js:421:36)
at async main (/home/dmitry/Templates/crm-frontend-v2/node_modules/eslint/bin/eslint.js:152:22)
Link to Minimal Reproducible Example
I have debuged it already
Additional comments
No response
The text was updated successfully, but these errors were encountered:
I decided to turn off the rule, but I would like to have this possibility, because some component could be written in js due to some circumstances and I cannot disable js linting, but I want to use some useful rules for ts
cbrgpl
changed the title
Cannot use ts-rules which requires "project" property when you both js and js languages lingting
Cannot use ts-rules which requires "project" property when you enable both js and js languages linting
Apr 3, 2024
cbrgpl
changed the title
Cannot use ts-rules which requires "project" property when you enable both js and js languages linting
Cannot use ts-rules which requires "project" property when you enable both js and ts languages linting
Apr 3, 2024
I'm having the same issue. Using @typescript-eslint/eslint-plugin and @typescript-eslint/parser @ versions ^6.21 works, but is only compatible with typescript up to ^5.3.
It's not optimal but at least fixes the issue you mentioned for now.
Before You File a Bug Report Please Confirm You Have Done The Following...
What version of ESLint are you using?
8.57.0
What version of
eslint-plugin-vue
andvue-eslint-parser
are you using?What did you do?
Configuration
What did you expect to happen?
I expect
@typescript-eslint/consistent-type-imports
rule will work correctly. It requires providingproject
option for@typescript-eslint/parser
. If I don't lint*.vue
files it works correctly.What actually happened?
I get error. I tried to fix it and understood that happens because of both languages linting enabled. When I change config to this:
Eslint works correctly(but ignores js written components by obviously reasons). I suppose
@typescript-eslint/parser
does not get value ofproject
fromparserOptions
, when you configured config by the first wayLink to Minimal Reproducible Example
I have debuged it already
Additional comments
No response
The text was updated successfully, but these errors were encountered: