yarn add -D @typescript-eslint/eslint-plugin @typescript-eslint/parser babel-eslint eslint-config-airbnb-typescript eslint-config-react-app eslint-import-resolver-typescript eslint-plugin-flowtype eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks
module.exports = {
env: {
browser: true,
es2020: true,
},
extends: ['plugin:react/recommended', 'airbnb-typescript'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2020,
sourceType: 'module',
project: ['./tsconfig.json'],
},
plugins: ['react', '@typescript-eslint'],
rules: {
'linebreak-style': 0,
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'react/jsx-filename-extension': [
2,
{ extensions: ['.js', '.jsx', '.ts', '.tsx'] },
],
},
ignorePatterns: ['.eslintrc.js'],
};