Description | Plugins | Setup | Configuration | Version | License
I created this ESLint extension with the goal of keeping my projects consistently standardized and simplifying the lint configuration process across different environments. The main idea is to centralize all the rules and path aliases I frequently use, ensuring consistency and code quality, regardless of the project.
I'm open to any suggestions that can contribute to the improvement of this shared ESLint configuration.
This configuration includes the following plugins:
- Typescript
- Stylistic
- Unicorn
- Promise
- Import
- Import Resolver Alias
- Security
- ESLint Comments
- React
- React Hooks
- Next
- JSX a11y
Install dependencies:
npm i -D eslint @lissone/eslint-config
Inside .eslintrc
:
{
"extends": "@lissone/eslint-config/next"
}
Install dependencies:
npm i -D eslint @lissone/eslint-config
Inside .eslintrc
:
{
"extends": "@lissone/eslint-config/react"
}
Install dependencies:
npm i -D eslint @lissone/eslint-config
Inside .eslintrc
:
{
"extends": "@lissone/eslint-config/node"
}
To configure import paths using this configuration, add the following to your .eslintrc
:
{
"settings": {
"import/resolver": {
"alias": {
"map": [
["@", "./src"],
["@shared", "./src/shared"]
],
"extensions": [".js", ".jsx", ".ts", ".tsx"]
}
}
}
}
If your project uses TypeScript, make sure to add these aliases to your tsconfig.json
as well:
{
"compilerOptions": {
"baseUrl": "./src",
"paths": {
"@/*": ["./*"],
"@shared/*": ["shared/*"]
}
}
}
You can override any rule specified in the base configuration. For example, to change the no-console
rule, add the following to your .eslintrc
:
{
"rules": {
"no-console": "warn"
}
}
This configuration requires ESLint version 8.57.0. If your project uses TypeScript, it is recommended to use a version above 5.0.0.
Distributed under the MIT License. See LICENSE
for more information.