-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy path.eslintrc.js
95 lines (94 loc) · 2.97 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
const { overrides } = require('@netlify/eslint-config-node')
module.exports = {
extends: '@netlify/eslint-config-node',
rules: {
'max-depth': 0,
complexity: 0,
'fp/no-let': 0,
'fp/no-loops': 0,
'fp/no-mutation': 0,
'fp/no-mutating-methods': 0,
'id-length': 0,
'max-statements': 0,
'no-await-in-loop': 0,
'n/exports-style': 0,
'n/global-require': 0,
'n/prefer-global/process': 0,
// Allow a single word inline so that it can do language tags for syntax highlighting
// ['error', { ignorePattern: /^ (\w+) $/ }],
'no-inline-comments': 0,
'no-magic-numbers': 0,
'no-param-reassign': 0,
'no-promise-executor-return': 0,
'no-prototype-builtins': 0,
'no-unused-vars': 0,
'prefer-regex-literals': 0,
'promise/prefer-await-to-callbacks': 0,
'unicorn/consistent-function-scoping': 0,
'unicorn/filename-case': 0,
'unicorn/no-array-push-push': 0,
'unicorn/numeric-separators-style': 0,
'max-lines': 0,
},
parserOptions: {
sourceType: 'module',
},
env: {
jest: true,
},
overrides: [
...overrides,
{
files: ['**/*.ts'],
rules: {
// This is disabled because TypeScript transpiles some features currently
// unsupported by Node 12, i.e. optional chaining
// TODO: re-enable after dropping support for Node 12
'n/no-unsupported-features/es-syntax': 'off',
'@typescript-eslint/no-extra-semi': 'off',
'n/no-missing-import': 'off',
// https://github.com/typescript-eslint/typescript-eslint/issues/2483
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
},
},
{
files: ['cypress/**/*.spec.ts'],
rules: {
'max-nested-callbacks': 0,
'promise/prefer-await-to-then': 0,
'promise/always-return': 0,
'promise/catch-or-return': 0,
},
},
{
files: ['test/**', 'packages/**/test/**'],
plugins: ['jest'],
extends: ['plugin:jest/recommended'],
rules: {
// Disable global rules
'max-nested-callbacks': 'off',
'@typescript-eslint/no-empty-function': 0,
'max-lines-per-function': 0,
'unicorn/no-empty-file': 0,
'prefer-destructuring': 0,
'@typescript-eslint/no-unused-vars': 0,
'unicorn/no-await-expression-member': 0,
'import/no-anonymous-default-export': 0,
'no-shadow': 0,
'@typescript-eslint/no-shadow': 0,
'@typescript-eslint/no-var-requires': 0,
'require-await': 0,
'n/no-sync': 0,
'promise/prefer-await-to-then': 0,
'no-async-promise-executor': 0,
'import/no-dynamic-require': 0,
// esling-plugin-jest specific rules
'jest/consistent-test-it': ['error', { fn: 'it', withinDescribe: 'it' }],
'jest/no-disabled-tests': 0,
'jest/no-conditional-expect': 0,
'jest/no-standalone-expect': [2, { additionalTestBlockFunctions: ['beforeAll'] }],
},
},
],
}