-
Notifications
You must be signed in to change notification settings - Fork 23
/
.eslintrc.cjs
108 lines (108 loc) · 2.98 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
module.exports = {
extends: [
'standard',
'plugin:prettier/recommended',
'plugin:jest/recommended',
'plugin:import/errors',
'plugin:import/warnings',
],
plugins: ['jest', 'local-rules'],
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
requireConfigFile: false,
babelOptions: {
plugins: [['@babel/plugin-syntax-decorators', { decoratorsBeforeExport: true }]],
},
},
env: { es6: true },
rules: {
// We have some weird naming conventions. TODO write a rule to enforce them.
camelcase: 'off',
// I think this is wrong. Let the transpiler dig it out for perf, but it belongs in the sources.
'no-return-await': 'off',
// Pure comments are usually inserted by transpilers, so bundlers expect an exact match.
'spaced-comment': ['error', 'always', { exceptions: ['#__PURE__'] }],
'local-rules/no-done-value': 'error',
},
globals: {
never: 'readonly',
Record: 'readonly',
},
overrides: [
{
files: ['src/!(?(__)methods)/**'],
rules: {
'import/no-default-export': 'error',
},
},
{
files: ['src/**.js'],
rules: {
'local-rules/no-impure-calls': 'error',
'node/file-extension-in-import': ['error', 'always'],
},
},
{
files: ['src/test', '**/__tests__/**'],
rules: {
'local-rules/no-impure-calls': 'off',
'import/no-unresolved': 'off',
},
},
{
files: ['*.ts'],
parser: '@typescript-eslint/parser',
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/no-empty-function': ['error', { allow: ['generatorFunctions'] }],
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'@typescript-eslint/class-name-casing': 'off', // can't deal with $PascalCased
'no-useless-constructor': 'off', // was causing `Cannot read property 'body' of null`
'import/no-unresolved': 'off',
},
},
{
files: ['$*'],
rules: {
'no-unused-expressions': 'off',
'import/no-unresolved': 'off',
},
},
{
files: ['**/__tests__/**/$*.test.{js,ts}'],
rules: {
'jest/valid-title': 'off',
// 'jest/valid-describe': 'off',
},
},
{
files: ['**/__tests__/**/*.test.{js,ts}'],
env: {
node: true,
jest: true,
},
rules: {
'local-rules/pure-curry': 'off',
'no-self-compare': 'off',
'jest/no-focused-tests': 'error',
'no-empty': ['error', { allowEmptyCatch: true }],
'@typescript-eslint/no-non-null-assertion': 'off',
},
},
{
files: ['src/internal/**.js'],
rules: {
'no-restricted-imports': [
'error',
{
patterns: ['**/methods/*'],
},
],
},
},
],
};