2.3.3 • Published 2 years ago
eslint-preset-basic v2.3.3
Shareable ESLint basic preset.
Usage
- Install package:
pnpm add --save-dev eslint eslint-preset-basic
- Create ESLint configuration file
eslint.config.js
:
import { defineFlatConfig, presetBasic } from 'eslint-preset-basic'
export default defineFlatConfig([
presetBasic({ enableTs: true }),
// {
// rules: {...}
// }
])
If your project does not specify
"type":"module"
in its package.json file, theneslint.config.js
must be in CommonJS format, such as:
module.exports = (async () => {
const { defineFlatConfig, presetBasic } = await import('eslint-preset-basic')
return defineFlatConfig([
presetBasic({ enableTs: true }),
// {
// rules: {...}
// }
])
})()
- Add script for package.json:
{
"scripts": {
"lint": "eslint .",
}
}
VS Code support
Install VS Code ESLint extension
Add the following settings to your project setting .vscode/settings.json
:
{
// Auto fix
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.organizeImports": false
},
// Enable the flat config support
"eslint.experimental.useFlatConfig": true,
// Enable eslint for supported languages
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
]
}
Please support this project by simply putting a star.
And, enjoy :)
2.3.0
2 years ago
2.3.2
2 years ago
2.3.1
2 years ago
2.3.3
2 years ago
2.2.2
2 years ago
2.2.1
2 years ago
2.2.0
2 years ago
2.1.1
2 years ago
2.1.0
2 years ago
0.0.1
2 years ago
0.0.0
2 years ago
2.0.3
2 years ago
2.0.2
2 years ago
2.0.1
2 years ago
2.0.0
2 years ago
1.3.1
2 years ago
1.3.0
2 years ago
1.2.6
2 years ago
1.2.5
2 years ago
1.2.4
2 years ago
1.2.3
2 years ago
1.2.2
2 years ago
1.2.1
2 years ago