Sharable eslint config created and used by CodingSans
This config created for eslint 8
yarn add -D eslint prettier @codingsans/eslint-config
or
npm install --save-dev eslint prettier @codingsans/eslint-config
Add .eslintrc.json
:
{
"extends": ["@codingsans/eslint-config/ts-recommended"]
}
Run:
eslint . --ext .ts
@codingsans/eslint-config/ts-recommended
: Recommended base configuration for typescript projects@codingsans/eslint-config/next-recommended
: Recommended configuration for NextJS apps@codingsans/eslint-config/angular-recommended
: Recommended configuration for Angular 12+ apps
Add the dbaeumer.vscode-eslint extension to the vscode, and thats all.
You could add this to your settings, to have auto-format, and auto import organize.
{
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"eslint.enable": true,
"editor.codeActionsOnSave": [
"source.organizeImports",
"source.fixAll"
],
}