WXL
4 天以前 3bd962a6d7f61239c020e2dbbeb7341e5b842dd1
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
import ljharb from '@ljharb/eslint-config/flat';
 
export default [
    ...ljharb,
    {
        ignores: [
            'test/resolver/malformed_package_json/package.json',
            'test/list-exports/**',
        ],
    },
    {
        rules: {
            'array-bracket-newline': 'off',
            complexity: 'off',
            'consistent-return': 'off',
            curly: 'off',
            'dot-notation': ['error', { allowKeywords: true }],
            'func-name-matching': 'off',
            'func-style': 'off',
            'global-require': 'warn',
            'id-length': ['error', { min: 1, max: 40 }],
            'max-depth': 'off',
            'max-lines-per-function': 'off',
            'max-lines': 'off',
            'max-nested-callbacks': 'off',
            'max-params': 'off',
            'max-statements-per-line': ['error', { max: 2 }],
            'max-statements': 'off',
            'multiline-comment-style': 'off',
            'no-magic-numbers': 'off',
            'no-shadow': 'off',
            'no-use-before-define': 'off',
            'sort-keys': 'off',
            strict: 'off',
        },
    },
    {
        files: ['**/*.js'],
        rules: {
            indent: ['error', 4],
        },
    },
    {
        files: ['bin/**'],
        rules: {
            'no-process-exit': 'off',
        },
    },
    {
        files: ['example/**'],
        rules: {
            'no-console': 'off',
        },
    },
    {
        files: ['test/resolver/nested_symlinks/mylib/*.js'],
        rules: {
            'no-throw-literal': 'off',
        },
    },
    {
        files: ['test/**'],
        languageOptions: {
            ecmaVersion: 5,
            parserOptions: {
                allowReserved: false,
            },
        },
        rules: {
            'dot-notation': ['error', { allowPattern: 'throws' }],
            'max-lines': 'off',
            'max-lines-per-function': 'off',
            'no-unused-vars': ['error', {
                vars: 'all',
                args: 'none',
                caughtErrors: 'none',
            }],
        },
    },
];