Skip to content

Lissone/eslint-config-lissone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lissone ESLint Config

Description   |    Plugins   |    Setup   |    Configuration   |    Version   |    License

License Repo size Top lang Stars repo Forks repo Pull requests Last commit

Report bug · Request feature

Description

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.

Plugins

This configuration includes the following plugins:

Setup

React (with Next.js)

Install dependencies:

npm i -D eslint @lissone/eslint-config

Inside .eslintrc:

{
  "extends": "@lissone/eslint-config/next"
}

React

Install dependencies:

npm i -D eslint @lissone/eslint-config

Inside .eslintrc:

{
  "extends": "@lissone/eslint-config/react"
}

Node.js

Install dependencies:

npm i -D eslint @lissone/eslint-config

Inside .eslintrc:

{
  "extends": "@lissone/eslint-config/node"
}

Configuration

Import Paths

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/*"]
    }
  }
}

Overriding Rules

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"
  }
}

Version

This configuration requires ESLint version 8.57.0. If your project uses TypeScript, it is recommended to use a version above 5.0.0.

License

Distributed under the MIT License. See LICENSE for more information.

Made with ❤️ by Lissone