2024-02-06 18:45:20 +08:00
|
|
|
// .eslintrc.js
|
|
|
|
|
module.exports = {
|
|
|
|
|
extends: [require.resolve('umi/eslint'), 'plugin:react-hooks/recommended'],
|
2025-08-11 15:31:38 +08:00
|
|
|
plugins: ['check-file'],
|
|
|
|
|
rules: {
|
|
|
|
|
'@typescript-eslint/no-use-before-define': [
|
|
|
|
|
'warn',
|
|
|
|
|
{
|
|
|
|
|
functions: false,
|
|
|
|
|
variables: true,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
'check-file/filename-naming-convention': [
|
|
|
|
|
'error',
|
|
|
|
|
{
|
2025-09-04 18:02:17 +08:00
|
|
|
'**/*.{jsx,tsx}': '[a-z0-9.-]*',
|
2025-08-20 16:32:29 +08:00
|
|
|
'**/*.{js,ts}': '[a-z0-9.-]*',
|
2025-08-11 15:31:38 +08:00
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
'check-file/folder-naming-convention': [
|
|
|
|
|
'error',
|
|
|
|
|
{
|
|
|
|
|
'src/**/': 'KEBAB_CASE',
|
|
|
|
|
'mocks/*/': 'KEBAB_CASE',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
'react/no-unescaped-entities': [
|
|
|
|
|
'warn',
|
|
|
|
|
{
|
|
|
|
|
forbid: [
|
|
|
|
|
{
|
|
|
|
|
char: "'",
|
|
|
|
|
alternatives: [''', '''],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
char: '"',
|
|
|
|
|
alternatives: ['"', '"'],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2024-02-06 18:45:20 +08:00
|
|
|
};
|