Can't match the glob pattern #18355
Answered
by
Rec0iL99
quxiaodong
asked this question in
Q&A
-
node version: 20.9.0 run the
|
Beta Was this translation helpful? Give feedback.
Answered by
Rec0iL99
Apr 17, 2024
Replies: 2 comments 9 replies
-
Hi @quxiaodong, could you please provide a reproducible example for us to have a better look? |
Beta Was this translation helpful? Give feedback.
9 replies
-
Hi @Rec0iL99 const { FlatCompat } = require('@eslint/eslintrc');
const path = require('path');
const { fileURLToPath } = require('url');
// 确保 __filename 和 __dirname 只声明一次
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
resolvePluginsRelativeTo: __dirname,
});
module.exports = [
// 扩展 @lobehub/lint 配置
...compat.extends('@lobehub/lint'),
// 其他建议配置
...compat.extends('plugin:@typescript-eslint/recommended'),
...compat.extends('plugin:react/recommended'),
// 自定义规则
{
files: ['src/**/*.{js,jsx,ts,tsx}', 'tests/**/*.{js,jsx,ts,tsx}'],
rules: {
'no-console': 'warn',
'no-debugger': 'error',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'semi': ['error', 'always'],
'quotes': ['error', 'single'],
'indent': ['error', 2],
},
},
// 忽略特定文件或目录
{
ignores: [
'node_modules/',
'coverage/',
'.coverage',
'jest*',
'*.test.ts',
'*.test.tsx',
'.umi',
'.umi-production',
'.umi-test',
'.dumi/tmp*',
'!.dumirc.ts',
'dist',
'es',
'lib',
'logs',
'.next',
],
},
]; which has declared identifier more than once. Please give me solution for dealing conflict. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At the moment
eslint-config-standard
does not support ESLint flat config.Relevant issues:
standard/eslint-config-standard#411
standard/eslint-config-standard#410
Docs on how to use an
eslintrc
config in flat config.https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config