/
.eslintrc.cjs
143 lines (138 loc) · 3.56 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
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
137
138
139
140
141
142
143
module.exports = {
env: {
browser: true,
es6: true,
mocha: true,
jest: true,
},
extends: ['standard', 'react-app', 'plugin:react/recommended', 'plugin:import/typescript', 'raine', 'prettier'],
// to be removed later
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
plugins: ['export-default-identifier', 'jsdoc', 'react', 'prettier'],
settings: {
react: {
version: 'detect',
},
},
rules: {
// export-default-identifier
'export-default-identifier/export-default-identifier': [
2,
{
types: ['Identifier', 'CallExpression', 'FunctionDeclaration'],
},
],
// jsdoc
'jsdoc/check-tag-names': [
2,
{
definedTags: ['packageDocumentation'],
},
],
'jsdoc/require-description-complete-sentence': [
2,
{
abbreviations: ['e.g.', 'i.e.'],
},
],
'jsdoc/require-jsdoc': [
2,
{
contexts: ['VariableDeclarator > ArrowFunctionExpression'],
require: {
ClassDeclaration: true,
ClassExpression: true,
},
},
],
// jsx-a11y
'jsx-a11y/anchor-is-valid': 0,
// react
'react/jsx-curly-spacing': 2,
'react/jsx-equals-spacing': 2,
'react/react-in-jsx-scope': 0,
'react/jsx-tag-spacing': [
2,
{
beforeSelfClosing: 'allow',
},
],
'react/no-children-prop': 0,
'react/no-unescaped-entities': 0,
'react/prop-types': 0,
// react-hooks
'react-hooks/exhaustive-deps': 2,
// prettier
'prettier/prettier': 2,
'arrow-body-style': 0,
'prefer-arrow-callback': 0,
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
env: {
browser: true,
es6: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
plugins: ['@typescript-eslint'],
settings: { react: { version: 'detect' } },
rules: {
semi: ['error', 'never'],
'import/prefer-default-export': 0,
// temporary fix from 'typescript-eslint' docs
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/no-unused-vars.md
'no-extra-parens': 0,
'no-unused-vars': 0,
'no-use-before-define': 0,
'@typescript-eslint/member-delimiter-style': [
2,
{
multiline: {
delimiter: 'none',
},
},
],
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-use-before-define': 2,
'@typescript-eslint/no-unused-vars': 2,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/array-type': 2,
// jsx
'jsx-quotes': [2, 'prefer-single'],
},
overrides: [
{
files: ['./src/**/*.ts', './src/**/*.tsx'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: { jsx: true },
ecmaVersion: 2018,
sourceType: 'module',
project: './tsconfig.json',
},
},
{
files: ['./src/e2e/**/*.ts'],
rules: {
'jsdoc/check-tag-names': 0,
},
},
],
},
],
}