Sharable eslint config created and used by CodingSans
This config created for eslint 6/7
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/typescript-recommended"]
}
Run:
eslint . --ext .ts
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"
],
}