I am getting error in eslint. I tried searching for solutions but couldn't find any. Can anyone help

80.57 Linting and checking validity of types ... 115.9 Failed to compile. 115.9 115.9 .eslintrc.cjs:8:13 115.9 Type error: Type 'string' has no properties in common with type 'Plugin'. 115.9 115.9 6 | tsconfigRootDir: __dirname, 115.9 7 | }, 115.9 > 8 | plugins: ["@typescript-eslint"], 115.9 | ^ 115.9 9 | extends: [ 115.9 10 | "next/core-web-vitals", 115.9 11 | "plugin:@typescript-eslint/recommended",
5 Replies
none23
none236mo ago
You seem to be using @types/eslint v9. Next currently doesn't supports eslint v9 https://github.com/vercel/next.js/issues/64409
Saurabh
SaurabhOP6mo ago
even specifying eslint version to 8.57 gives the same error
Linting and checking validity of types ..Failed to compile.

.eslintrc.cjs:8:13
Type error: Type 'string' has no properties in common with type 'Plugin'.

6 | tsconfigRootDir: __dirname,
7 | },
> 8 | plugins: ["@typescript-eslint"],
| ^
9 | extends: [
10 | "next/core-web-vitals",
11 | "plugin:@typescript-eslint/recommended",
Linting and checking validity of types ..Failed to compile.

.eslintrc.cjs:8:13
Type error: Type 'string' has no properties in common with type 'Plugin'.

6 | tsconfigRootDir: __dirname,
7 | },
> 8 | plugins: ["@typescript-eslint"],
| ^
9 | extends: [
10 | "next/core-web-vitals",
11 | "plugin:@typescript-eslint/recommended",
none23
none236mo ago
How do you declare types for .eslintrc.cjs?
Teifko
Teifko5w ago
I'm running into the same issue and this thread is the only thing I was able to find. The open issue has since been resolved and eslint 9 is now compatible with nextjs 15. Did anyone else run into this issue? I found a solution and add it here, as this is the only search result for this error: I switched the type from /** @type {import("eslint").Linter.Config} */ in the .eslintrc.cjs to: /** @type {import("@typescript-eslint/utils/ts-eslint").ClassicConfig.Config} */, to explicitly tell it to use the classic config the Create T3 App is still using. I won't open a issue for this though, as there is already an issue open to switch to the new flat config anyway (https://github.com/t3-oss/create-t3-app/issues/1955), but until then this might help people using Create T3 App that want to use NextJS 15 with ESlint 9.
eh0218
eh02185w ago
You could see about potentially downgrading versions? Not sure if anyone has suggested that yet, but seeing as how Next doesn’t support that current version of ESLint, that would be a quick way to unblock yourself

Did you find this page helpful?