Skip to main content
Version: 2.1

Usage with eslint 8

note

If you are using eslint version 8.57 or below, use @nish1896/eslint-config package.

To set up ESLint, create a .eslintrc, .eslintrc.js or .eslintrc.json file in your project root. Use this file to specify the configuration for your application by referring to the relevant section of this guide.

touch .eslintrc.js

Node.js​

For Node.js applications, use only the js configuration this package. This import is essential for all JavaScript-based projects, as it defines the recommended set of JavaScript-specific linting rules and ensures consistent code quality.

module.exports = {
extends: [
"@nish1896/eslint-config/js"
],
rules: {}
}

React & Vite​

The react import of this package contains the relevant rules for linting jsx code.

module.exports = {
extends: [
"@nish1896/eslint-config/js",
"@nish1896/eslint-config/react"
],
rules: {}
}

NextJS​

The existing react import caused conflicts with the eslint-plugin-react-hooks plugin, which prevented linting to execute. From version 2.1.0 onwards, a separate next import has been introduced to address these conflicts, since NextJS also provides its own set of eslint configuration.

If you are using this configuration in a NextJS Application, it is highly recommended to upgrade to version 2.1.0 or above.

module.exports = {
extends: [
"@nish1896/eslint-config/js",
"@nish1896/eslint-config/next"
],
rules: {}
}