Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
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 havesearched for related issues and found none that matched my issue.
- I haveread the FAQ and my problem is not listed.
Relevant Package
utils
Playground Link
No response
Repro Code
import*asespreefrom'espree';importeslintfrom'@eslint/js';importtseslintAfrom'typescript-eslint';exportdefaulttseslintA.config(eslint.configs.recommended, ...tseslintA.configs.recommendedTypeChecked,{files:['index.ts'],languageOptions:{parser:espree,parserOptions:{EXPERIMENTAL_useProjectService:true,}}});
ESLint Config
No response
tsconfig
No response
Expected Result
ESLint doesn't always know theparserName
provided in rule contexts:
* @param{string|undefined}parserNameThenameoftheparserintheconfig
lintingProblems=runRules(sourceCode,configuredRules,ruleId=>getRuleFromConfig(ruleId,config),void0,
Actual Result
...but we define it as:
typescript-eslint/packages/utils/src/ts-eslint/Rule.ts
Lines 196 to 199 inc322099
/** | |
* The rule ID. | |
*/ | |
id:string; |
And now we have this unfortunate stdout bug - note theParser: undefined
:
Error: Error while loading rule '@typescript-eslint/await-thenable': 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: undefinedNote: 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 /Users/josh/repos/repros/index.ts
Additional Info
I'll file an ESLint issue soon asking that ESLint tries to glean that parser name if possible. Theespree
module exports aname = 'espree'
that can be useful.
Edit:eslint/eslint#18645
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin | 7.15.0 |
@typescript-eslint/parser | 7.15.0 |
@typescript-eslint/utils | 7.15.0 |
ESLint | 8.6.0 |
💖