-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
136 lines (136 loc) · 3.33 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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
module.exports = {
plugins: ['@typescript-eslint', 'jsx-a11y', 'import', 'prettier', 'unicorn'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:jsx-a11y/recommended',
'plugin:import/typescript',
'plugin:prettier/recommended',
'plugin:unicorn/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
ecmaVersion: 12,
sourceType: 'module',
},
env: {
jest: true,
browser: true,
node: true,
es2021: true,
},
rules: {
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/no-empty-interface': 'error',
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
vars: 'all',
varsIgnorePattern: '^_',
},
],
'import/newline-after-import': 'error',
'import/no-duplicates': ['error', { 'prefer-inline': false }],
'import/no-unresolved': 'error',
'import/order': [
'error',
{
alphabetize: {
caseInsensitive: true,
order: 'asc',
},
groups: [
'builtin',
'external',
'internal',
['sibling', 'parent'],
'index',
'object',
'type',
'unknown',
],
'newlines-between': 'always-and-inside-groups',
pathGroups: [
{
group: 'external',
pattern: 'react',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['react'],
},
],
'jsx-a11y/alt-text': 'off',
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link'],
specialLink: ['to'],
},
],
'jsx-a11y/label-has-associated-control': [
'error',
{
depth: 5,
},
],
'jsx-a11y/media-has-caption': 'off',
'jsx-a11y/no-autofocus': 'off',
'jsx-a11y/no-onchange': 'off',
'newline-before-return': 'error',
'no-console': 'error',
'no-const-assign': 'error',
'no-debugger': 'error',
'no-extra-semi': 'off',
'no-param-reassign': 'error',
'no-prototype-builtins': 0,
'no-undef': 'error',
'no-unexpected-multiline': 'error',
'no-unused-vars': 'off',
'object-curly-newline': [
'error',
{
consistent: true,
},
],
'object-shorthand': 'error',
'prefer-destructuring': [
'error',
{
AssignmentExpression: {
array: false,
object: false,
},
VariableDeclarator: {
array: false,
object: true,
},
},
],
'prefer-template': 'error',
'prettier/prettier': 'error',
'react/react-in-jsx-scope': 'off',
'unicorn/filename-case': 'off',
'unicorn/no-nested-ternary': 'off',
'unicorn/no-null': 'off',
'unicorn/no-useless-undefined': 'off',
'unicorn/prefer-string-replace-all': 'off',
'unicorn/prevent-abbreviations': 'off',
},
ignorePatterns: ['node_modules/', 'dist/', '*.js', '*.cjs', '*.test.ts*', 'src/template/**/*'],
settings: {
'import/resolver': {
typescript: {},
},
react: {
version: 'detect',
},
},
};