-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
92 lines (92 loc) · 2.25 KB
/
.eslintrc.cjs
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
module.exports = {
root: true,
env: {browser: true, es2021: true},
extends: [
'eslint:recommended',
'plugin:import/recommended',
'plugin:jsx-a11y/recommended',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
'plugin:react-i18n/recommended',
'prettier',
],
overrides: [
{
files: ['**/*.ts?(x)'],
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:import/typescript',
],
},
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
plugins: ['simple-import-sort', 'prettier', '@typescript-eslint', 'react-i18n'],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: '.',
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {},
node: {
paths: ['src'],
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
react: {
version: 'detect',
},
},
rules: {
'prettier/prettier': ['error', {}, {usePrettierrc: true}],
'arrow-parens': 0,
'no-debugger': 1,
'no-warning-comments': [
1,
{
terms: ['hardcoded'],
location: 'anywhere',
},
],
'no-return-await': 0,
'object-curly-spacing': ['error', 'always'],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'no-var': 'error',
'comma-dangle': [1, 'always-multiline'],
'linebreak-style': ['error', 'unix'],
'max-len': [
1,
{
code: 100,
comments: 100,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
},
],
'no-console': [
1,
{
allow: ['warn', 'error'],
},
],
'react-i18n/no-dynamic-translation-keys': 'error',
'react-i18n/no-missing-interpolation-keys': 'error',
'react/jsx-curly-brace-presence': ['warn', 'never'],
// disable unnecessary rules from recommendations
'react/display-name': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
},
}