forked from consta-design-system/uikit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
119 lines (119 loc) · 3.07 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
module.exports = {
env: {
browser: true,
node: true,
es6: true,
jest: true,
},
extends: [
'airbnb',
'airbnb/hooks',
'plugin:import/typescript',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'prettier/@typescript-eslint',
'prettier/react',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
parser: '@typescript-eslint/parser',
parserOptions: {
createDefaultProgram: true,
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2019,
sourceType: 'module',
project: './tsconfig.json',
},
plugins: [
'react',
'import',
'jsx-a11y',
'react-hooks',
'@typescript-eslint',
'simple-import-sort',
],
overrides: [
{
files: '*.js',
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
],
rules: {
'func-names': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'quote-props': ['error', 'consistent-as-needed'],
'react/prop-types': 'off',
'react/destructuring-assignment': 'off',
'react/jsx-filename-extension': ['error', { extensions: ['.jsx', '.tsx'] }],
'react/jsx-props-no-spreading': 'off',
'react/state-in-constructor': 'off',
'react/static-property-placement': 'off',
'react/require-extension': 'off',
'sort-imports': 'off',
'import/named': 'off',
'import/order': 'off',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'import/no-extraneous-dependencies': 'off',
'import/prefer-default-export': 'off',
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'simple-import-sort/sort': [
'error',
{
// https://github.com/lydell/eslint-plugin-simple-import-sort/blob/master/examples/.eslintrc.js#L71
groups: [
['^.+\\.s?css$'],
[
'^(assert|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|https|module|net|os|path|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|tty|url|util|vm|zlib|freelist|v8|process|async_hooks|http2|perf_hooks)(/.*|$)',
],
['^react', '^@?\\w'],
['^\\u0000'],
['^\\.\\.(?!/?$)', '^\\.\\./?$'],
['^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
],
},
],
'import/no-cycle': 'off',
'no-unused-vars': 'error',
'no-restricted-syntax': 'off',
'consistent-return': 'off',
'no-unused-expressions': 'off',
'react/no-array-index-key': 'off',
'no-shadow': 'off',
'no-plusplus': 'off',
'react-hooks/exhaustive-deps': 'off',
'default-case': 'off',
'jsx-a11y/label-has-associated-control': [
'error',
{
required: {
some: ['nesting', 'id'],
},
},
],
'jsx-a11y/label-has-for': [
'error',
{
required: {
some: ['nesting', 'id'],
},
},
],
},
};