Next.js Discord

Discord Forum

ESLint v9 migration. Next build folder included.

Answered
Korat posted this in #help-forum
Open in Discord
KoratOP
Hi everyone. I'm trying to migrate eslint of my nextjs boilerplate (https://github.com/OreQr/next-clean-boilerplate) to v9.

Everything seems working but it starts including .js files from .next build folder, even when I manually ignore it with config.

Error on every .js file in .next folder:
.next/static/development/_buildManifest.js
Error: Parsing error: ESLint was configured to run on `<tsconfigRootDir>/.next\static\development\_buildManifest.js` using `parserOption
However, that TSConfig does not include this file. Either:
- Change ESLint's list of included files to not include this file
- Change that TSConfig to include this file
- Create a new TSConfig that includes this file and include it in your parserOptions.project
See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-of-those-tsconfigs-include-this-file

6 Replies

KoratOP
eslint
tsconfig
{
  "compilerOptions": {
    "target": "ES2017",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "bundler",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "plugins": [
      {
        "name": "next"
      }
    ],
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "include": [
    "next-env.d.ts",
    "**/*.mjs",
    "**/*.ts",
    "**/*.tsx",
    ".next/types/**/*.ts"
  ],
  "exclude": ["node_modules"]
}
KoratOP
It starts working when I added { ignores: [".next"] } on top of eslint config. But before I doesn't need to do that. I'm missing something?
KoratOP
Now I checked and it doesn't lint .ts .tsx files
KoratOP
Answer