-
-
Notifications
You must be signed in to change notification settings - Fork 768
/
.eslintrc.js
112 lines (112 loc) · 2.61 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
module.exports = {
env: {
browser: true,
node: true,
es6: true,
jest: true,
webextensions: true,
},
extends: [
'eslint:recommended',
'plugin:node/recommended',
'plugin:react/recommended',
'prettier',
],
parser: '@babel/eslint-parser',
parserOptions: {
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true,
legacyDecorators: true,
},
sourceType: 'module',
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
parser: '@typescript-eslint/parser',
rules: {
'import/no-unresolved': 'error',
'@typescript-eslint/array-type': ['error', { default: 'array' }],
'@typescript-eslint/ban-types': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
'no-dupe-class-members': 'off',
'no-undef': 'off',
'no-unused-vars': 'off',
'no-inner-declarations': 0, // for typescript namespace
},
},
],
plugins: [
'@typescript-eslint',
'import',
'jest',
'react',
'prettier',
'no-only-tests',
],
rules: {
'prettier/prettier': 'error',
'react/prop-types': [0],
'no-const-assign': 'error',
'no-this-before-super': 'error',
'no-undef': 'error',
'no-unreachable': 'error',
'no-unused-vars': [
'error',
{ varsIgnorePattern: '^_', args: 'all', argsIgnorePattern: '^_' },
],
'constructor-super': 'error',
'valid-typeof': 'error',
'no-only-tests/no-only-tests': 'error',
'node/no-unpublished-require': [
'error',
{
allowModules: ['electron'],
},
],
'node/no-unsupported-features/es-syntax': 0,
'node/no-unsupported-features/node-builtins': 0,
'node/shebang': [
'error',
{
convertPath: {
'src/**/*.js': ['src/(.+)$', 'dist/$1'],
'src/**/*.ts': ['src/(.+)ts$', 'dist/$1js'],
},
},
],
'node/no-missing-require': [
'error',
{
allowModules: ['electron'],
tryExtensions: ['.js', '.jsx', '.json', '.ts', '.tsx', '.node'],
},
],
'node/no-missing-import': [
'error',
{
allowModules: ['electron'],
tryExtensions: ['.js', '.jsx', '.json', '.ts', '.tsx', '.node'],
},
],
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
package: ['./tsconfig.json', './packages/*/tsconfig.json'],
},
},
react: {
version: 'detect',
},
},
root: true,
}