Blog>
Snippets

Ignoring specific files and directories

Illustrate the creation and configuration of an `.eslintignore` file to exclude files like `next.config.js`, `node_modules`, and `out` from linting in Next.js.
// .eslintignore
next.config.js
node_modules
out
This is the content of the `.eslintignore` file. It includes three lines, each specifying a pattern to exclude from linting by ESLint. The `next.config.js` is the specific file to ignore, `node_modules` is a directory where dependency files are kept, and `out` is typically a build directory for Next.js projects. Adding these lines to the `.eslintignore` file instructs ESLint to ignore these files and directories when linting the codebase.