-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreact-typescript.js
125 lines (124 loc) · 3.77 KB
/
react-typescript.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
const reactTypescript = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'react', 'jest', 'filenames', 'import'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:jest/recommended',
'plugin:react/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'airbnb',
'airbnb/hooks',
],
env: {
node: true,
jest: true,
es2021: true,
browser: true,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2021,
sourceType: 'module',
},
rules: {
strict: [0, 'global'],
indent: [1, 4, {SwitchCase: 1, VariableDeclarator: 1}],
'no-tabs': 0,
'no-console': [1, {allow: ['warn']}],
'max-len': [
2,
120,
2,
{
ignoreUrls: true,
ignoreComments: false,
},
],
'no-underscore-dangle': [
'error',
{
allow: [
'_id',
'_index',
'_score',
'_shards',
'_source',
'_type',
'_state',
'_embedded',
],
},
],
'no-restricted-syntax': [
'error',
'ForInStatement',
'LabeledStatement',
'WithStatement',
],
'no-await-in-loop': 0,
'no-param-reassign': ['error', {props: false}],
'prefer-destructuring': 0,
'jest/no-disabled-tests': 'error',
'jest/no-focused-tests': 'error',
'jest/no-identical-title': 'error',
'jest/valid-expect': 'error',
'react/no-unused-state': 'error',
'react/jsx-handler-names': 1,
'react/jsx-props-no-spreading': 0,
'react/forbid-prop-types': 0,
'filenames/match-regex': [2, '^[a-z0-9-.]+$', true],
'filenames/match-exported': [2, 'kebab'],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
optionalDependencies: false,
peerDependencies: false,
},
],
'import/no-namespace': 'error',
'react/jsx-filename-extension': [1, {extensions: ['.tsx', '.jsx']}],
'react/prop-types': 0,
'no-unused-vars': 0,
'import/named': 0,
'import/prefer-default-export': 0,
'import/no-unresolved': 0,
'import/extensions': 0,
'default-case': 0,
'no-use-before-define': 0,
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/member-delimiter-style': 'error',
'@typescript-eslint/member-ordering': 'error',
'@typescript-eslint/type-annotation-spacing': 'error',
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/prefer-interface': 0,
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/ban-ts-ignore': 0,
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'react/function-component-definition': [
2,
{namedComponents: 'arrow-function'},
],
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
},
react: {
version: 'detect',
},
},
};
module.exports = reactTypescript;