ESLint 9 defaults to flat config and eslint-config-next was pinned at 15 while Next is on 16, so eslint only ran with ESLINT_USE_FLAT_CONFIG=false and next lint is gone on Next 16. Replace .eslintrc.json with a native flat eslint.config.mjs (config-next 16 ships flat configs, so no FlatCompat shim is needed), bump eslint-config-next to 16.2.6, add @eslint/js and typescript-eslint as explicit devDeps for the recommended rule sets, and point the lint script at eslint directly. This only makes eslint runnable on modern tooling; it does not wire it into CI. The same rules carry over (next/core-web-vitals, eslint and typescript-eslint recommended, prettier, unused-imports)
34 lines
1021 B
JavaScript
34 lines
1021 B
JavaScript
import js from "@eslint/js";
|
|
import tseslint from "typescript-eslint";
|
|
import nextCoreWebVitals from "eslint-config-next/core-web-vitals";
|
|
import prettier from "eslint-config-prettier/flat";
|
|
import unusedImports from "eslint-plugin-unused-imports";
|
|
|
|
const eslintConfig = [
|
|
{
|
|
ignores: [".next/**", "out/**", "build/**", "coverage/**", "next-env.d.ts"],
|
|
},
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
...nextCoreWebVitals,
|
|
prettier,
|
|
{
|
|
plugins: { "unused-imports": unusedImports },
|
|
rules: {
|
|
"unused-imports/no-unused-imports": "error",
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
"@typescript-eslint/no-unused-vars": "off",
|
|
"@typescript-eslint/no-unused-expressions": "off",
|
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
"prefer-const": "off",
|
|
"no-empty": "off",
|
|
"no-prototype-builtins": "off",
|
|
"no-useless-catch": "off",
|
|
"no-useless-escape": "off",
|
|
"no-self-assign": "off",
|
|
},
|
|
},
|
|
];
|
|
|
|
export default eslintConfig;
|