@ergou_rrrr/eslint-config
v1.1.1
Published
Ray's ESLint config
Readme
@ergou_rrrr/eslint-config
[!IMPORTANT] This repo is built on top of @antfu/eslint-config with some of my personal preferences, if you are looking for a more general purpose config, please check it out. If you really appreciate this config, please consider to sponsor antfu.
Usage
Install
pnpm i -D eslint @ergou_rrrr/eslint-configCreate config file
With "type": "module" in package.json (recommended):
// eslint.config.js
import ray from '@ergou_rrrr/eslint-config'
export default rayWith CJS:
// eslint.config.js
const ray = require('@ergou_rrrr/eslint-config').default
module.exports = rayNote that
.eslintignoreno longer works in Flat config, see customization for more details.
Add script for package.json
For example:
{
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}VS Code support (auto fix)
Install VS Code ESLint extension
Add the following settings to your .vscode/settings.json:
{
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,
// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,
// Auto fix
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "never"
},
// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
],
// Enable eslint for all supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact",
"vue",
"html",
"markdown",
"json",
"jsonc",
"yaml"
]
}