- Install
yarn add -D @tiffinger-thiel/eslint-config @rushstack/eslint-config eslint
- Setup your config files .eslintrc.js
// For yarn2 you will need this
require('@rushstack/eslint-config/patch/modern-module-resolution');
module.exports = {
// Pick one profile.
// Possible profiles:
// - @tiffinger-thiel/eslint-config/profile/react
// - @tiffinger-thiel/eslint-config/profile/node
// - @tiffinger-thiel/eslint-config/profile/nest
extends: ['@tiffinger-thiel/eslint-config/profile/react'],
// The following is optional, it speeds up prettier if passed.
// It should match your react version.
settings: {
react: {
version: '18.0'
}
}
};
.prettierrc.js
module.exports = require('@tiffinger-thiel/eslint-config/prettier');
package.json
{
"scripts": {
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\""
},
}
You only need "dbaeumer.vscode-eslint"
. No Prettier plugin needed.
Example .vscode/settings.json
:
{
"eslint.format.enable": true,
"editor.formatOnSave": true,
"[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[javascriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescriptreact]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
}
Run following
yarn
yarn release