/
.eslintrc.js
80 lines (80 loc) · 2.22 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
module.exports = {
root: true,
env: {
es6: true,
node: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
settings: {
react: {
version: 'detect',
},
},
plugins: ['node', 'react', 'react-hooks', '@typescript-eslint', 'prettier'],
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:node/recommended',
],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'node/no-missing-import': ['off'], // Path alias not supported
'node/shebang': [
'error',
{
convertPath: {
'lib/*.ts': ['^lib/(.+?)\\.ts$', 'dist/$1.js'],
},
},
],
'no-process-exit': 'off',
'prettier/prettier': 'error',
'node/no-unsupported-features/es-syntax': 'off',
'node/no-missing-require': [
'error',
{
tryExtensions: ['.js', '.ts', '.tsx'],
},
],
},
overrides: [
{
files: ['*.tsx'],
rules: {
'react/prop-types': ['off'], // Covered by React.FC
},
},
{
files: ['ci/**', 'repositories/**'],
rules: {
'node/no-unpublished-require': 'off',
'node/no-unpublished-import': 'off',
},
},
{
files: ['*config*', 'ci/**', 'test/**/*.ts*', '*.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['*.test.ts*', '**/__mocks__/*'],
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
},
],
};