generated from netlify/build-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 18
/
.eslintrc.js
63 lines (62 loc) · 1.79 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
const { overrides } = require('@netlify/eslint-config-node')
module.exports = {
extends: ['@netlify/eslint-config-node'],
rules: {
// For now
'func-style': 'off',
// This is compiled, so we can use modern syntax
'node/no-unsupported-features/es-syntax': 'off',
// This is a duplicate of `import/no-duplicates` but can handle "import type"
'no-duplicate-imports': 'off',
'max-depth': ['error', 4],
'n/no-missing-import': 'off',
},
env: {
jest: true,
},
parserOptions: {
sourceType: 'module',
},
overrides: [
...overrides,
{
// Tests use lots of nested callbacks
files: ['*-test.js', '*.spec.js', '**/e2e-tests/*.js'],
rules: {
'max-nested-callbacks': 'off',
},
},
{
// Templates import files from the site itself and needs lots of dynamic requires
files: ['plugin/src/templates/**/*'],
rules: {
'n/no-unpublished-import': 'off',
'@typescript-eslint/no-var-requires': 'off',
'n/global-require': 'off',
'import/no-dynamic-require': 'off',
'import/no-unresolved': 'off',
'n/no-unpublished-require': 'off',
'n/no-missing-require': 'off',
'n/no-missing-import': 'off',
'max-lines': 'off',
complexity: 'off',
'max-statements': 'off',
'n/prefer-global/process': 'off',
'unicorn/filename-case': 'off',
},
},
{
files: ['plugin/test/**/*'],
rules: {
'n/no-unpublished-import': 'off',
'max-lines': 'off',
'n/no-unpublished-require': 'off',
'n/no-missing-require': 'off',
'n/no-missing-import': 'off',
'@typescript-eslint/no-var-requires': 'off',
'n/global-require': 'off',
'n/prefer-global/process': 'off',
},
},
],
}