@livewing/eslint-config
ESLint shareable configs
Installation
npm i -D eslint prettier typescript @livewing/eslint-config
Usage
Create .editorconfig
file in your project root.
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
Then specify @livewing
in the extends
section of your ESLint configuration.
# .eslintrc.yml
root: true
extends: "@livewing"
If you are using React, specify @livewing/eslint-config/react
instead of @livewing
.
# .eslintrc.yml
root: true
extends: "@livewing/eslint-config/react"
Examples
Next.js + Tailwind CSS
npm i -D eslint-config-next eslint-plugin-tailwindcss
# .eslintrc.yml
root: true
extends:
- "@livewing/eslint-config/react"
- next/core-web-vitals
- plugin:tailwindcss/recommended
rules:
jsx-a11y/anchor-is-valid: off
Visual Studio Code settings
// .vscode/extensions.json
{
"recommendations": [
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode"
]
}
// .vscode/settings.json
{
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"typescript.tsdk": "node_modules/typescript/lib",
"[javascript]": {
"editor.formatOnSave": false
},
"[javascriptreact]": {
"editor.formatOnSave": false
},
"[typescript]": {
"editor.formatOnSave": false
},
"[typescriptreact]": {
"editor.formatOnSave": false
}
}