0.43.0 • Published 14 days ago

@lidofinance/eslint-config v0.43.0

Weekly downloads
-
License
MIT
Repository
github
Last release
14 days ago

Lido ESint config

Automated, non-opinionated ESLint config foundation

Please note that this ESLint config is still 0.x and is subject to significant changes; it is mainly used by internal Lido teams.

Installation

npm install --dev @lidofinance/eslint-config
# and plugins
npm install --dev eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-import-resolver-typescript eslint-plugin-eslint-comments eslint-plugin-import eslint-plugin-jest eslint-plugin-promise eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-sonarjs eslint-plugin-unicorn @next/eslint-plugin-next

If using TypeScript, alter tsconfig.json line includes to include everything, like that: "include": ["**/*","**/.*"]

ℹ️ Modern module resolution ESLint patch by Rush team is intentionally not used, as it conflicts with same patch in @next/eslint-plugin.

Configuration

Style rules are intentionally not provided; bring your own code style, whatever it is - prettier, airbnb, xo or standard.

// .eslintrc.js.js
{
  "root": true,
  
  "extends": [
    // note: use every other config BEFORE @lidofinance config, 
    // EXCEPT prettier; prettier is bundled with multiple 
    // disable rules that should be turned off to avoid conflicts
    
    //"airbnb",
    "@lidofinance",
    //"prettier"
  ]
}

What's inside

@lidofinance/eslint-config is feature-packed config that ships with some logic.

Following assumptions are done:

  • ES version target is latest (2022); if you need other, change env in .eslintrc
  • code is always server-ready
  • code is client-ready if react package is present
  • there is no magic resolution mechanism and usage of webpack loaders; only explicit file paths and tsconfig.json paths are considered
  • latest version of TypeScript (4.6.x) and ESLint (^8.13) are used

For performance, developer experience and accuracy reasons some rules will turn on if following conditions will happen:

  • React package is declared in package.json
    • react, react-hooks rules will be used
  • Next package is declared in package.json
    • next plugin rules will be used
    • react rule react/react-in-jsx-scope will turn off
  • Jest package is declared in package.json
    • jest plugin rules will be used
    • some rules will be disabled (like "avoid code duplication" and "do not use any") for test-specific file patterns
  • Typescript package is declared in package.json:
    • typescript-eslint rules will be enabled
    • parser will be switched to typescript-eslint
    • if tsconfig.json is present, type-level lint rules will be enabled
    • if compilerOptions.strict is true, additional anti-any rules will be enabled
0.43.0

14 days ago

0.42.0

2 months ago

0.41.0

2 months ago

0.40.0

3 months ago

0.39.1

5 months ago

0.39.0

7 months ago

0.38.0

8 months ago

0.37.1

8 months ago

0.37.0

8 months ago

0.36.0

8 months ago

0.35.0

9 months ago

0.34.0

9 months ago

0.33.0

10 months ago

0.32.0

10 months ago

0.31.0

10 months ago

0.30.0

10 months ago

0.29.0

10 months ago

0.28.0

11 months ago

0.21.0

1 year ago

0.27.0

11 months ago

0.26.0

11 months ago

0.25.0

12 months ago

0.24.0

12 months ago

0.23.0

12 months ago

0.22.0

12 months ago

0.20.0

1 year ago

0.19.0

1 year ago

0.17.0

1 year ago

0.18.0

1 year ago

0.14.0

1 year ago

0.15.0

1 year ago

0.16.0

1 year ago

0.11.0

1 year ago

0.12.0

1 year ago

0.13.0

1 year ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago