@kaivanwong/eslint-config-monorepo v0.17.0
@kaivanwong/eslint-config
Kaivan Wong's ESLint config presets
Usage
Install
pnpm i eslint @kaivanwong/eslint-config -D
Config .eslintrc
Add .eslintrc
to your project directory
{
"extends": "@kaivanwong"
}
You don't need .eslintignore normally as it has been provided by the preset. In the case of monorepo, you need to add
"root":true
to.eslintrc
to specify the root configuration file
Add script for package.json
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}
Config VS Code auto fix
Install VS Code ESLint extension extension and create .vscode/settings.json
{
"prettier.enable": false,
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
Customization rules
Add you like rules to your .eslintrc
file:
{
"extends": [
"@kaivanwong"
],
"rules": {
// ...
}
}
TypeScript Aware Rules
Type aware rules are enabled when a tsconfig.eslint.json
is found in the project root, which will introduce some stricter rules into your project. If you want to enable it while have no tsconfig.eslint.json
in the project root, you can change tsconfig name by modifying ESLINT_TSCONFIG
env.
// .eslintrc.js
process.env.ESLINT_TSCONFIG = 'tsconfig.json'
module.exports = {
extends: '@kaivanwong'
}
Thanks
This project is based on @antfu/eslint-config
License
MIT licensed © 2022-PRESENT Kaivan Wong
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
11 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago