I read in an article that the TypeScript core team explaining ESLint has a more performant architecture than TSLint. And on the other hand @typescript-eslint/parser
makes a more convenient AST which works the best alongside @typescript-eslint/eslint-plugin
.
Now I have a feeling that my tslintrc
file has not a good setup of plugins and extensions.
- Is it good to follow Airbnb rules in
tsx
or just go with the standard rules? - What should be the sequence of including
extends
andplugins
that they do not override each other and get the best linting and auto-fixing out of it? - The app created with CRA
yarn create react-app myapp --typescript
and have not changed anything in thetsconfig.json
This is my .eslintrc.js
module.exports = {
env: {
browser: true,
es6: true,
node: true
},
parser: "@typescript-eslint/parser",
extends: [
"plugin:@typescript-eslint/recommended",
"react-app",
"plugin:prettier/recommended",
"prettier",
"prettier/react"
],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly"
},
parserOptions: {
ecmaFeatures: {
tsx: true
},
ecmaVersion: 2018,
sourceType: "module"
},
plugins: ["@typescript-eslint", "react", "prettier"],
rules: {
indent: ["error", "tab"],
"linebreak-style": ["error", "unix"],
quotes: ["error", "single"],
semi: ["error", "always"]
}
};
// and these parts in the VSCode setting
"eslint.validate": [
"javascript",
"javascriptreact",
{ "language": "typescript", "autoFix": true },
{ "language": "typescriptreact", "autoFix": true }
],
"prettier.eslintIntegration": true,
Also if someone knows a good setting in a project in GitHub/Gist that would be appritiated.