typescript-eslint: Bug: 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.
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.
Issue Description
We managed to port our config to the ESLint version.
We are running the linter over the whole project and we get this:
Oops! Something went wrong! :(
ESLint: 9.9.0
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: typescript-eslint/parser
Occurred while linting /media/Storage/Projects/Experiments/react-ts-vite-template/commitlint.config.cts
at throwError (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/@typescript-eslint+utils@8.1.0_eslint@9.9.0_jiti@1.21.6__typescript@5.5.4/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js:38:11)
at getParserServices (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/@typescript-eslint+utils@8.1.0_eslint@9.9.0_jiti@1.21.6__typescript@5.5.4/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js:27:9)
at create (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/@typescript-eslint+eslint-plugin@8.1.0_@typescript-eslint+parser@8.1.0_eslint@9.9.0_jiti@1.21_qd7z265jhdasnyghzhgsasp6ne/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js:46:55)
at Object.create (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/@typescript-eslint+utils@8.1.0_eslint@9.9.0_jiti@1.21.6__typescript@5.5.4/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js:31:20)
at createRuleListeners (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:977:21)
at /media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:1108:84
at Array.forEach (<anonymous>)
at runRules (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:1039:34)
at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:1947:31)
at Linter._verifyWithFlatConfigArray (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:2086:21)
It is pretty interesting since we are ignoring such a file on our configuration:
import globals from "globals";
import js from "@eslint/js";
import typescript from "typescript-eslint";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import playwright from "eslint-plugin-playwright";
import sonarJs from "eslint-plugin-sonarjs";
import vitest from "@vitest/eslint-plugin";
import jsxA11y from "eslint-plugin-jsx-a11y";
import prettier from "eslint-config-prettier";
import stylistic from "@stylistic/eslint-plugin";
import query from "@tanstack/eslint-plugin-query";
/**
* eslint-config-airbnb,
* eslint-config-airbnb-typescript,
* eslint-import-resolver-typescript,
* eslint-plugin-import,
* eslint-plugin-jest-dom,
* eslint-plugin-testing-library,
* eslint-plugin-react-hooks
*
* missing
*/
export default [
// { files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"] },
{
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
...react.configs.flat.recommended,
plugins: {
react,
reactHooks,
"@stylistic": stylistic,
},
languageOptions: {
...react.configs.flat.recommended.languageOptions,
globals: {
...globals.browser,
...globals.es2021,
},
},
rules: {
"react/function-component-definition": [
2,
{ namedComponents: "arrow-function" },
],
"react/hook-use-state": 2,
"react/jsx-handler-names": 2,
"react/require-default-props": [
"error",
{
functions: "defaultArguments",
},
],
"@stylistic/comma-dangle": [
"error",
{
arrays: "only-multiline",
objects: "only-multiline",
imports: "only-multiline",
exports: "only-multiline",
functions: "never",
},
],
"@stylistic/function-paren-newline": "warn",
"@stylistic/implicit-arrow-linebreak": "warn",
"@stylistic/indent": ["error", 2],
"@stylistic/object-curly-newline": [
"error",
{
ExportDeclaration: { multiline: true, minProperties: 5 },
},
],
"@stylistic/operator-linebreak": "warn",
"@stylistic/quotes": ["error", "double"],
"@stylistic/semi": "error",
},
settings: {
vitest: {
typecheck: true,
},
},
},
// react.configs.flat.recommended,
...query.configs["flat/recommended"],
js.configs.recommended,
...typescript.configs.recommendedTypeChecked,
{
ignores: [
"coverage/",
"dist/",
"node_modules/",
"eslint.config.js",
"commitlint.config.cts",
"playwright.config.ts",
"postcss.config.ts",
"tailwind.config.ts",
"vite.config.mts",
"public/mockServiceWorker.js",
],
languageOptions: {
globals: {
...globals.serviceworker,
...globals.browser,
...globals.es2021,
},
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"@typescript-eslint/array-type": [
"error",
{
default: "generic",
},
],
"@typescript-eslint/ban-ts-comment": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/explicit-function-return-type": 1,
"@typescript-eslint/naming-convention": [
"error",
{
selector: "typeParameter",
format: ["PascalCase"],
custom: { regex: "^T[A-Z]", match: true },
},
],
"@typescript-eslint/switch-exhaustiveness-check": "error",
},
settings: {
react: {
version: "detect",
},
},
},
jsxA11y.flatConfigs.recommended,
sonarJs.configs.recommended,
{
files: ["src/**/*.test.[tj]s?(x)"],
ignores: ["src/**/*.e2e.test.[tj]s?(x)"],
plugins: {
vitest,
},
rules: {
...vitest.configs.all.rules,
"vitest/valid-title": [
"error",
{
mustMatch: {
it: [
"^should.*when.+$",
"Test title must include 'should' and 'when'",
],
},
},
],
},
languageOptions: {
globals: {
...vitest.environments.env.globals,
},
},
},
{
...playwright.configs["flat/recommended"],
files: ["tests/**/*.test.[tj]s?(x)"],
},
prettier,
];
We removed that file and run the linter again:
Warning: React version not specified in eslint-plugin-react settings. See https://github.com/jsx-eslint/eslint-plugin-react#configuration .
Oops! Something went wrong! :(
ESLint: 9.9.0
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: typescript-eslint/parser
Occurred while linting /media/Storage/Projects/Experiments/react-ts-vite-template/eslint.config.js
at throwError (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/@typescript-eslint+utils@8.1.0_eslint@9.9.0_jiti@1.21.6__typescript@5.5.4/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js:38:11)
at getParserServices (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/@typescript-eslint+utils@8.1.0_eslint@9.9.0_jiti@1.21.6__typescript@5.5.4/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js:27:9)
at create (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/@typescript-eslint+eslint-plugin@8.1.0_@typescript-eslint+parser@8.1.0_eslint@9.9.0_jiti@1.21_qd7z265jhdasnyghzhgsasp6ne/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js:46:55)
at Object.create (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/@typescript-eslint+utils@8.1.0_eslint@9.9.0_jiti@1.21.6__typescript@5.5.4/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js:31:20)
at createRuleListeners (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:977:21)
at /media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:1108:84
at Array.forEach (<anonymous>)
at runRules (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:1039:34)
at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:1947:31)
at Linter._verifyWithFlatConfigArray (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:2086:21)
Again you check our configuration, it is also ignored!
Our current folder is as follows:
Now, let’s lint only the source folder:
pnpm eslint src --fix 2 ✘ 5s
/media/Storage/Projects/Experiments/react-ts-vite-template/src/application/utils/test-utils.tsx
5:61 warning Missing return type on function @typescript-eslint/explicit-function-return-type
10:34 warning Missing return type on function @typescript-eslint/explicit-function-return-type
18:51 warning Missing return type on function @typescript-eslint/explicit-function-return-type
24:5 warning Missing return type on function @typescript-eslint/explicit-function-return-type
30:73 warning Missing return type on function @typescript-eslint/explicit-function-return-type
/media/Storage/Projects/Experiments/react-ts-vite-template/src/infrastructure/api/service.ts
3:31 warning Missing return type on function @typescript-eslint/explicit-function-return-type
/media/Storage/Projects/Experiments/react-ts-vite-template/src/main.tsx
18:8 warning Missing return type on function @typescript-eslint/explicit-function-return-type
33:1 warning Missing return type on function @typescript-eslint/explicit-function-return-type
/media/Storage/Projects/Experiments/react-ts-vite-template/src/presentation/App.tsx
3:16 warning Missing return type on function @typescript-eslint/explicit-function-return-type
/media/Storage/Projects/Experiments/react-ts-vite-template/src/presentation/components/ErrorBox/ErrorBox.test.tsx
8:3 warning Every test should have either `expect.assertions(<number of assertions>)` or `expect.hasAssertions()` as its first expression vitest/prefer-expect-assertions
20:5 warning Too many assertion calls (6). Maximum is 5 vitest/max-expects
21:5 warning Too many assertion calls (7). Maximum is 5 vitest/max-expects
24:5 warning Too many assertion calls (8). Maximum is 5 vitest/max-expects
27:3 warning Every test should have either `expect.assertions(<number of assertions>)` or `expect.hasAssertions()` as its first expression vitest/prefer-expect-assertions
34:3 warning Every test should have either `expect.assertions(<number of assertions>)` or `expect.hasAssertions()` as its first expression vitest/prefer-expect-assertions
/media/Storage/Projects/Experiments/react-ts-vite-template/src/presentation/components/Spinner/Spiner.test.tsx
6:3 warning Every test should have either `expect.assertions(<number of assertions>)` or `expect.hasAssertions()` as its first expression vitest/prefer-expect-assertions
13:3 warning Every test should have either `expect.assertions(<number of assertions>)` or `expect.hasAssertions()` as its first expression vitest/prefer-expect-assertions
23:3 warning Every test should have either `expect.assertions(<number of assertions>)` or `expect.hasAssertions()` as its first expression vitest/prefer-expect-assertions
31:3 warning Every test should have either `expect.assertions(<number of assertions>)` or `expect.hasAssertions()` as its first expression vitest/prefer-expect-assertions
/media/Storage/Projects/Experiments/react-ts-vite-template/src/presentation/components/Spinner/Spinner.tsx
1:20 warning Missing return type on function @typescript-eslint/explicit-function-return-type
/media/Storage/Projects/Experiments/react-ts-vite-template/src/reportWebVitals.ts
3:70 warning Missing return type on function @typescript-eslint/explicit-function-return-type
✖ 21 problems (0 errors, 21 warnings)
No issues!!!
Now we got issues, It happens when running eslint --fix, even when running it on the source folder:
✖ eslint src --fix:
Warning: React version not specified in eslint-plugin-react settings. See https://github.com/jsx-eslint/eslint-plugin-react#configuration .
Oops! Something went wrong! :(
ESLint: 9.9.0
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: typescript-eslint/parser
Occurred while linting /media/Storage/Projects/Experiments/react-ts-vite-template/eslint.config.js
at throwError (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/@typescript-eslint+utils@8.1.0_eslint@9.9.0_jiti@1.21.6__typescript@5.5.4/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js:38:11)
at getParserServices (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/@typescript-eslint+utils@8.1.0_eslint@9.9.0_jiti@1.21.6__typescript@5.5.4/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js:27:9)
at create (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/@typescript-eslint+eslint-plugin@8.1.0_@typescript-eslint+parser@8.1.0_eslint@9.9.0_jiti@1.21_qd7z265jhdasnyghzhgsasp6ne/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js:46:55)
at Object.create (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/@typescript-eslint+utils@8.1.0_eslint@9.9.0_jiti@1.21.6__typescript@5.5.4/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js:31:20)
at createRuleListeners (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:977:21)
at /media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:1108:84
at Array.forEach (<anonymous>)
at runRules (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:1039:34)
at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:1947:31)
at Linter._verifyWithFlatConfigArray (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:2086:21)
Why?
As context, we are using husky to run lint-staged on every commit with the following instructions:
{
"*.{js,jsx,ts,tsx}": ["prettier --check --write", "eslint --fix --debug"],
"*.css": ["prettier --check --write"],
"*.json": ["prettier --check --write"]
}
Here it is a more detailed debug log:
git commit -m "chore: :wrench: migrate eslint configuration to new format" ✔
> react-ts-vite-template@1.2.6 lint-staged /media/Storage/Projects/Experiments/react-ts-vite-template
> lint-staged
✔ Preparing lint-staged...
⚠ Running tasks for staged files...
❯ .lintstagedrc — 1 file
❯ *.{js,jsx,ts,tsx} — 1 file
✔ prettier --check --write
✖ eslint --fix --debug [FAILED]
↓ *.css — no files
↓ *.json — no files
↓ Skipped because of errors from tasks.
✔ Reverting to original state because of errors...
✔ Cleaning up temporary files...
✖ eslint --fix --debug:
2024-08-15T22:40:51.841Z eslint:cli CLI args: [ '--fix', '--debug', '/media/Storage/Projects/Experiments/react-ts-vite-template/eslint.config.js' ]
2024-08-15T22:40:51.843Z eslint:cli Using flat config? true
2024-08-15T22:40:51.850Z eslint:cli Running on files
2024-08-15T22:40:51.852Z eslint:eslint Using file patterns: /media/Storage/Projects/Experiments/react-ts-vite-template/eslint.config.js
2024-08-15T22:40:51.853Z eslint:eslint Searching for eslint.config.js
2024-08-15T22:40:51.858Z eslint:eslint Loading config from /media/Storage/Projects/Experiments/react-ts-vite-template/eslint.config.js
2024-08-15T22:40:51.858Z eslint:eslint Config file URL is file:///media/Storage/Projects/Experiments/react-ts-vite-template/eslint.config.js
2024-08-15T22:40:53.254Z eslint:rules Loading rule 'consistent-return' (remaining=289)
2024-08-15T22:40:53.285Z eslint:rules Loading rule 'dot-notation' (remaining=288)
2024-08-15T22:40:53.297Z eslint:rules Loading rule 'init-declarations' (remaining=287)
2024-08-15T22:40:53.299Z eslint:rules Loading rule 'max-params' (remaining=286)
2024-08-15T22:40:53.333Z eslint:rules Loading rule 'no-dupe-class-members' (remaining=285)
2024-08-15T22:40:53.342Z eslint:rules Loading rule 'no-empty-function' (remaining=284)
2024-08-15T22:40:53.367Z eslint:rules Loading rule 'no-invalid-this' (remaining=283)
2024-08-15T22:40:53.370Z eslint:rules Loading rule 'no-loop-func' (remaining=282)
2024-08-15T22:40:53.372Z eslint:rules Loading rule 'no-loss-of-precision' (remaining=281)
2024-08-15T22:40:53.375Z eslint:rules Loading rule 'no-magic-numbers' (remaining=280)
2024-08-15T22:40:53.411Z eslint:rules Loading rule 'no-restricted-imports' (remaining=279)
2024-08-15T22:40:53.509Z eslint:rules Loading rule 'no-unused-expressions' (remaining=278)
2024-08-15T22:40:53.518Z eslint:rules Loading rule 'no-useless-constructor' (remaining=277)
2024-08-15T22:40:53.538Z eslint:rules Loading rule 'prefer-destructuring' (remaining=276)
2024-08-15T22:40:55.596Z eslint:eslint Deleting cache file at /media/Storage/Projects/Experiments/react-ts-vite-template/.eslintcache
2024-08-15T22:40:55.598Z eslint:eslint 1 files found in: 2ms
2024-08-15T22:40:55.653Z eslint:rules Loading rule 'constructor-super' (remaining=275)
2024-08-15T22:40:55.655Z eslint:rules Loading rule 'for-direction' (remaining=274)
2024-08-15T22:40:55.657Z eslint:rules Loading rule 'getter-return' (remaining=273)
2024-08-15T22:40:55.658Z eslint:rules Loading rule 'no-async-promise-executor' (remaining=272)
2024-08-15T22:40:55.659Z eslint:rules Loading rule 'no-case-declarations' (remaining=271)
2024-08-15T22:40:55.660Z eslint:rules Loading rule 'no-class-assign' (remaining=270)
2024-08-15T22:40:55.660Z eslint:rules Loading rule 'no-compare-neg-zero' (remaining=269)
2024-08-15T22:40:55.661Z eslint:rules Loading rule 'no-cond-assign' (remaining=268)
2024-08-15T22:40:55.662Z eslint:rules Loading rule 'no-const-assign' (remaining=267)
2024-08-15T22:40:55.663Z eslint:rules Loading rule 'no-constant-binary-expression' (remaining=266)
2024-08-15T22:40:55.664Z eslint:rules Loading rule 'no-constant-condition' (remaining=265)
2024-08-15T22:40:55.666Z eslint:rules Loading rule 'no-control-regex' (remaining=264)
2024-08-15T22:40:55.669Z eslint:rules Loading rule 'no-debugger' (remaining=263)
2024-08-15T22:40:55.670Z eslint:rules Loading rule 'no-delete-var' (remaining=262)
2024-08-15T22:40:55.671Z eslint:rules Loading rule 'no-dupe-args' (remaining=261)
2024-08-15T22:40:55.672Z eslint:rules Loading rule 'no-dupe-else-if' (remaining=260)
2024-08-15T22:40:55.673Z eslint:rules Loading rule 'no-dupe-keys' (remaining=259)
2024-08-15T22:40:55.674Z eslint:rules Loading rule 'no-duplicate-case' (remaining=258)
2024-08-15T22:40:55.675Z eslint:rules Loading rule 'no-empty' (remaining=257)
2024-08-15T22:40:55.677Z eslint:rules Loading rule 'no-empty-character-class' (remaining=256)
2024-08-15T22:40:55.679Z eslint:rules Loading rule 'no-empty-pattern' (remaining=255)
2024-08-15T22:40:55.681Z eslint:rules Loading rule 'no-empty-static-block' (remaining=254)
2024-08-15T22:40:55.682Z eslint:rules Loading rule 'no-ex-assign' (remaining=253)
2024-08-15T22:40:55.683Z eslint:rules Loading rule 'no-extra-boolean-cast' (remaining=252)
2024-08-15T22:40:55.686Z eslint:rules Loading rule 'no-fallthrough' (remaining=251)
2024-08-15T22:40:55.688Z eslint:rules Loading rule 'no-func-assign' (remaining=250)
2024-08-15T22:40:55.689Z eslint:rules Loading rule 'no-global-assign' (remaining=249)
2024-08-15T22:40:55.690Z eslint:rules Loading rule 'no-import-assign' (remaining=248)
2024-08-15T22:40:55.692Z eslint:rules Loading rule 'no-invalid-regexp' (remaining=247)
2024-08-15T22:40:55.695Z eslint:rules Loading rule 'no-irregular-whitespace' (remaining=246)
2024-08-15T22:40:55.697Z eslint:rules Loading rule 'no-misleading-character-class' (remaining=245)
2024-08-15T22:40:55.708Z eslint:rules Loading rule 'no-new-native-nonconstructor' (remaining=244)
2024-08-15T22:40:55.709Z eslint:rules Loading rule 'no-nonoctal-decimal-escape' (remaining=243)
2024-08-15T22:40:55.710Z eslint:rules Loading rule 'no-obj-calls' (remaining=242)
2024-08-15T22:40:55.712Z eslint:rules Loading rule 'no-octal' (remaining=241)
2024-08-15T22:40:55.713Z eslint:rules Loading rule 'no-prototype-builtins' (remaining=240)
2024-08-15T22:40:55.714Z eslint:rules Loading rule 'no-redeclare' (remaining=239)
2024-08-15T22:40:55.715Z eslint:rules Loading rule 'no-regex-spaces' (remaining=238)
2024-08-15T22:40:55.717Z eslint:rules Loading rule 'no-self-assign' (remaining=237)
2024-08-15T22:40:55.719Z eslint:rules Loading rule 'no-setter-return' (remaining=236)
2024-08-15T22:40:55.721Z eslint:rules Loading rule 'no-shadow-restricted-names' (remaining=235)
2024-08-15T22:40:55.722Z eslint:rules Loading rule 'no-sparse-arrays' (remaining=234)
2024-08-15T22:40:55.722Z eslint:rules Loading rule 'no-this-before-super' (remaining=233)
2024-08-15T22:40:55.723Z eslint:rules Loading rule 'no-undef' (remaining=232)
2024-08-15T22:40:55.725Z eslint:rules Loading rule 'no-unreachable' (remaining=231)
2024-08-15T22:40:55.726Z eslint:rules Loading rule 'no-unsafe-finally' (remaining=230)
2024-08-15T22:40:55.727Z eslint:rules Loading rule 'no-unsafe-negation' (remaining=229)
2024-08-15T22:40:55.728Z eslint:rules Loading rule 'no-unsafe-optional-chaining' (remaining=228)
2024-08-15T22:40:55.729Z eslint:rules Loading rule 'no-unused-labels' (remaining=227)
2024-08-15T22:40:55.730Z eslint:rules Loading rule 'no-unused-private-class-members' (remaining=226)
2024-08-15T22:40:55.731Z eslint:rules Loading rule 'no-useless-backreference' (remaining=225)
2024-08-15T22:40:55.734Z eslint:rules Loading rule 'no-useless-catch' (remaining=224)
2024-08-15T22:40:55.735Z eslint:rules Loading rule 'no-useless-escape' (remaining=223)
2024-08-15T22:40:55.737Z eslint:rules Loading rule 'no-with' (remaining=222)
2024-08-15T22:40:55.738Z eslint:rules Loading rule 'require-yield' (remaining=221)
2024-08-15T22:40:55.739Z eslint:rules Loading rule 'use-isnan' (remaining=220)
2024-08-15T22:40:55.740Z eslint:rules Loading rule 'valid-typeof' (remaining=219)
2024-08-15T22:40:55.775Z eslint:eslint Lint /media/Storage/Projects/Experiments/react-ts-vite-template/eslint.config.js
2024-08-15T22:40:55.775Z eslint:linter Linting code for /media/Storage/Projects/Experiments/react-ts-vite-template/eslint.config.js (pass 1)
2024-08-15T22:40:55.775Z eslint:linter Verify
2024-08-15T22:40:55.775Z eslint:linter With flat config: /media/Storage/Projects/Experiments/react-ts-vite-template/eslint.config.js
2024-08-15T22:40:55.776Z eslint:languages:js Parsing: /media/Storage/Projects/Experiments/react-ts-vite-template/eslint.config.js
2024-08-15T22:40:55.824Z eslint:languages:js Parsing successful: /media/Storage/Projects/Experiments/react-ts-vite-template/eslint.config.js
2024-08-15T22:40:55.824Z eslint:languages:js Scope analysis: /media/Storage/Projects/Experiments/react-ts-vite-template/eslint.config.js
2024-08-15T22:40:55.824Z eslint:languages:js Scope analysis successful: /media/Storage/Projects/Experiments/react-ts-vite-template/eslint.config.js
Warning: React version not specified in eslint-plugin-react settings. See https://github.com/jsx-eslint/eslint-plugin-react#configuration .
2024-08-15T22:40:55.850Z eslint:linter An error occurred while traversing
2024-08-15T22:40:55.850Z eslint:linter Filename: /media/Storage/Projects/Experiments/react-ts-vite-template/eslint.config.js
2024-08-15T22:40:55.850Z eslint:linter Parser Options: { ecmaFeatures: { jsx: true } }
2024-08-15T22:40:55.850Z eslint:linter Settings: { vitest: { typecheck: true } }
Oops! Something went wrong! :(
ESLint: 9.9.0
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: typescript-eslint/parser
Occurred while linting /media/Storage/Projects/Experiments/react-ts-vite-template/eslint.config.js
at throwError (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/@typescript-eslint+utils@8.1.0_eslint@9.9.0_jiti@1.21.6__typescript@5.5.4/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js:38:11)
at getParserServices (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/@typescript-eslint+utils@8.1.0_eslint@9.9.0_jiti@1.21.6__typescript@5.5.4/node_modules/@typescript-eslint/utils/dist/eslint-utils/getParserServices.js:27:9)
at create (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/@typescript-eslint+eslint-plugin@8.1.0_@typescript-eslint+parser@8.1.0_eslint@9.9.0_jiti@1.21_qd7z265jhdasnyghzhgsasp6ne/node_modules/@typescript-eslint/eslint-plugin/dist/rules/await-thenable.js:46:55)
at Object.create (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/@typescript-eslint+utils@8.1.0_eslint@9.9.0_jiti@1.21.6__typescript@5.5.4/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js:31:20)
at createRuleListeners (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:977:21)
at /media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:1108:84
at Array.forEach (<anonymous>)
at runRules (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:1039:34)
at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:1947:31)
at Linter._verifyWithFlatConfigArray (/media/Storage/Projects/Experiments/react-ts-vite-template/node_modules/.pnpm/eslint@9.9.0_jiti@1.21.6/node_modules/eslint/lib/linter/linter.js:2086:21)
ELIFECYCLE Command failed with exit code 1.
husky - pre-commit script failed (code 1)]
There is nothing about installing a parser on the getting stating docs.
Reproduction Repository Link
https://github.com/SalahAdDin/react-ts-vite-template
Repro Steps
- clone the repo
git checkout dev- copy paste the configuration code
- either run lint staged or make a commit
- see the error
Versions
| package | version |
|---|---|
@types/eslint__js |
8.42.3 |
@eslint/js |
9.9.0 |
typescript-eslint |
8.1.0 |
TypeScript |
5.5.4 |
ESLint |
9.9.0 |
node |
X.Y.Z |
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (8 by maintainers)
I don’t see it in a separate object. A separate object would be:
If it worked in v8 but fails in v9 and you didn’t make other changes, it could be something different. But we can’t help you without a MINIMAL reproduction, so please make one.