-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
51 lines (51 loc) · 1.78 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
project: ['./tsconfig.json'], // we need this for rules that require type information, such as restrict-plus-operands
},
settings: {
react: {
version: 'detect',
},
},
plugins: ['@typescript-eslint', 'react-hooks', 'import'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:react/recommended',
'plugin:prettier/recommended', // show prettier errors as ESLint errors. This should be the last configuration in the extends array.
],
rules: {
curly: ['error', 'multi-line'],
eqeqeq: 'error',
'no-throw-literal': 'error',
'require-await': 'error',
'sort-imports': ['error', { ignoreDeclarationSort: true }],
'react-hooks/rules-of-hooks': 'error', // checks rules of Hooks
'react-hooks/exhaustive-deps': 'error', // checks effect dependencies
'react/prop-types': 'off', // this rules conflicts with the use of React.FC<props>
'react/display-name': 'off',
'react/jsx-uses-react': 'off',
'react/react-in-jsx-scope': 'off',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-unused-vars': ['error', { vars: 'all', args: 'all', argsIgnorePattern: '^_' }],
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/await-thenable': 'error',
'import/newline-after-import': ['error', { count: 1 }],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
},
],
'import/group-exports': 'error',
'import/exports-last': 'error',
},
}