eslint-config-ristretto
v1.1.0
Published
A Shareable ESLint Config based on AirBnB Style
Downloads
10
Maintainers
Readme
eslint-config-ristretto
This package provides Ristretto's base .eslintrc (without React plugins) as an extensible shared config.
Features
- Updated AirBnB rules
- @typescript-eslint
- eslint-plugin-import
- eslint-plugin-promise
- eslint-import-resolver-typescript (used for tsconfig paths)
Installation
Install eslint-config-ristretto with your package manager of choice:
npm:
npm i -D eslint eslint-config-ristretto
yarn:
yarn add -D eslint eslint-config-ristretto
pnpm:
pnpm i -D eslint eslint-config-ristretto
Usage
Once you have installed the package, add "ristretto"
to your .eslintrc extends
array:
{
"extends": ["ristretto"]
}
Example config
{
"extends": [
"ristretto",
"plugin:prettier/recommended"
],
"plugins": ["prettier"],
"ignorePatterns": ["node_modules"],
"rules": {
"prettier/prettier": [
"error",
{},
{
"usePrettierrc": true,
},
]
}
}
If your project uses any type IoC (e.g. NestJs), also add "ristretto/ioc"
to your .eslintrc extends
array:
{
"extends": ["ristretto", "ristretto/ioc"]
}
Example config
{
"env": {
"es2021": true,
"node": true
},
"extends": [
"ristretto",
"ristretto/ioc",
"plugin:prettier/recommended"
],
"plugins": ["prettier"],
"ignorePatterns": ["node_modules"],
"rules": {
"prettier/prettier": [
"error",
{},
{
"usePrettierrc": true,
},
]
}
}