.eslintrc.js 2.1 KB
Newer Older
1
module.exports = {
2 3 4 5 6
    env: {
        browser: true,
        es6: true,
        node: true
    },
7
    extends: ['plugin:prettier/recommended'],
8 9 10 11
    parserOptions: {
        ecmaVersion: 2018,
        sourceType: 'module'
    },
12
    ignorePatterns: ['node_modules/', 'dist/', 'output/', '_next'],
13
    rules: {
14 15
        'no-console': 'warn',
        'sort-imports': 'error'
16 17 18 19 20 21 22 23 24 25 26 27
    },
    overrides: [
        {
            files: ['packages/cli/**/*', 'packages/mock/**/*', 'packages/server/**/*', 'packages/serverless/**/*'],
            extends: [
                'plugin:@typescript-eslint/recommended',
                'prettier/@typescript-eslint',
                'plugin:prettier/recommended'
            ],
            parser: '@typescript-eslint/parser',
            rules: {
                '@typescript-eslint/explicit-function-return-type': 'off',
P
Peter Pan 已提交
28
                '@typescript-eslint/explicit-module-boundary-types': 'off',
29 30 31 32 33 34 35 36
                '@typescript-eslint/no-explicit-any': 'error'
            }
        },
        {
            files: ['packages/core/**/*', 'packages/i18n/**/*'],
            extends: [
                'plugin:@typescript-eslint/recommended',
                'plugin:react/recommended',
37
                'plugin:react-hooks/recommended',
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
                'prettier/@typescript-eslint',
                'plugin:prettier/recommended'
            ],
            parser: '@typescript-eslint/parser',
            parserOptions: {
                ecmaFeatures: {
                    jsx: true
                },
                ecmaVersion: 2018,
                sourceType: 'module'
            },
            settings: {
                react: {
                    version: 'detect'
                }
            },
            rules: {
                '@typescript-eslint/explicit-function-return-type': 'off',
P
Peter Pan 已提交
56
                '@typescript-eslint/explicit-module-boundary-types': 'off',
57 58
                '@typescript-eslint/no-explicit-any': 'error',
                'react/prop-types': 'off',
59
                'react/react-in-jsx-scope': 'off'
60 61 62
            }
        }
    ]
63
};