1.0.8 • Published 10 months ago
@dashbrains/eslint-config v1.0.8
@dashbrains/eslint-config
- Single quotes, no semi
- Auto fix for formatting
- Designed to work with TypeScript, React out-of-box
- Sorted imports, dangling commas
- Reasonable defaults, best practices, only one-line of config
- Style principle: Minimal for reading, stable for diff
Usage
Install
pnpm add -D eslint @dashbrains/eslint-configConfig .eslintrc
{
"extends": "@dashbrains/eslint-config"
}Add script for package.json
For example:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}Config VS Code auto fix
Install VS Code ESLint extension and create .vscode/settings.json
{
"prettier.enable": true,
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}Prettier
If you want to apply formatting with prettier, you can add the following to your .prettierrc:
{
"singleQuote": true,
"tabWidth": 2,
"semi": false
}and then
npm i -D prettierFAQ
I prefer XXX...
Sure, you can override the rules in your .eslintrc file.
{
"extends": "@dashbrains/eslint-config",
"rules": {
// your rules...
}
}Or you can always fork this repo and make your own.
License
MIT License © 2019-PRESENT DashBrains