This package provides an ESLint configuration for Next.js projects using TypeScript and React. It includes a set of rules and plugins to ensure code quality and consistency.
To install the package, run the following command:
npm install --save-dev @luccasfr/eslint-config-nextjs
Install all peer-dependencies:
npm install --save-dev @typescript-eslint/eslint-plugin @typescript-eslint/parser eslint-plugin-import eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-unicorn
ESLint and Next.js are not included in the install script, as it is assumed you are already using Next.js and ESLint.
To use this ESLint configuration in your project, extend it in your .eslintrc file:
{
"extends": [
"@luccasfr/eslint-config-nextjs"
],
"rules": {
// ...
}
}
This configuration includes the following rules and plugins:
- @typescript-eslint
- eslint-plugin-import
- eslint-plugin-react
- eslint-plugin-react-hooks
- eslint-plugin-unicorn
- plugin:react-hooks/recommended
- next/core-web-vitals
- plugin:react/recommended
- plugin:import/errors
- plugin:import/warnings
- plugin:unicorn/recommended
- "react/react-in-jsx-scope": "off"
- "react/prop-types": "off"
- "no-unused-vars": "off"
- "import/no-unused-modules": ["error"]
- "unicorn/filename-case": ["error", { "case": "kebabCase" }]
- "unicorn/prevent-abbreviations": ["off"]
- "@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^", "varsIgnorePattern": "^", "ignoreRestSiblings": true, "args": "after-used" }]
Make sure to install the following peer dependencies:
- @typescript-eslint/eslint-plugin
- @typescript-eslint/parser
- @tanstack/eslint-plugin-query
- eslint (>=8.57.0)
- eslint-plugin-import
- eslint-plugin-react
- eslint-plugin-react-hooks
- eslint-plugin-unicorn
- next
Lucas Ferreira - lucas.ferreira@jerasoft.inf.br
This project is licensed under the ISC License.