Open In App

How to ignore ESLint in Next.js ?

Last Updated : 02 Feb, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we are going to see how to ignore ESLint in Next.Js. Follow the below steps to ignore ESLint in the Next.js application:

ESLint: ESLint is a JavaScript linter that is designed to help identify and correct problems in JavaScript code. ESLint is based on JSHint, but ESLint has more features and is more configurable. ESLint can be used to enforce a coding style, to detect errors and potential problems, and help improve code quality.

Creating NextJs application:

Step 1: To create a new NextJs App run the below command in your terminal:

npx create-next-app GFG

Step 2: After creating your project folder (i.e. GFG ), move to it by using the following command:

cd GFG

Project Structure: It will look like this.

Example: Ignore ESLint in Next.Js, if the ESLint is enabled the production build of your application will fail automatically if any error is present in the code. To ignore the ESLint in Next.Js add the below code in your ‘next.config.js’ file:

next.config.js




module.exports = {
    reactStrictMode: true,
    eslint: {
      ignoreDuringBuilds: true,
    },
}


Output: After adding the above code to your ‘next.config.file’, the ESLint will be ignored in your Next.Js file.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads