2020-12-04 21:15:41 +08:00
|
|
|
module.exports = {
|
|
|
|
env: {
|
|
|
|
browser: true,
|
|
|
|
es6: true,
|
|
|
|
commonjs: true,
|
|
|
|
node: true,
|
2023-03-20 20:49:22 +08:00
|
|
|
'jest/globals': true,
|
2020-12-04 21:15:41 +08:00
|
|
|
},
|
|
|
|
root: true,
|
|
|
|
extends: [
|
|
|
|
'eslint:recommended',
|
|
|
|
'plugin:@typescript-eslint/eslint-recommended',
|
|
|
|
'plugin:@typescript-eslint/recommended',
|
|
|
|
'plugin:prettier/recommended',
|
|
|
|
'plugin:react/recommended',
|
2023-03-20 20:49:22 +08:00
|
|
|
'plugin:jest/recommended',
|
2020-12-04 21:15:41 +08:00
|
|
|
],
|
|
|
|
parser: '@typescript-eslint/parser',
|
|
|
|
parserOptions: {
|
|
|
|
project: 'tsconfig.eslint.json',
|
2023-03-20 20:49:22 +08:00
|
|
|
sourceType: 'module',
|
2020-12-04 21:15:41 +08:00
|
|
|
},
|
|
|
|
plugins: ['@typescript-eslint', 'jest'],
|
|
|
|
rules: {
|
|
|
|
'@typescript-eslint/naming-convention': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
selector: 'interface',
|
|
|
|
format: ['PascalCase'],
|
|
|
|
custom: {
|
|
|
|
regex: '^I[A-Z]',
|
2023-03-20 20:49:22 +08:00
|
|
|
match: true,
|
|
|
|
},
|
|
|
|
},
|
2020-12-04 21:15:41 +08:00
|
|
|
],
|
|
|
|
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
|
|
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
|
|
'@typescript-eslint/no-namespace': 'off',
|
|
|
|
'@typescript-eslint/no-var-requires': 'off',
|
|
|
|
'@typescript-eslint/no-use-before-define': 'off',
|
|
|
|
'@typescript-eslint/no-empty-interface': 'off',
|
|
|
|
'@typescript-eslint/quotes': [
|
|
|
|
'error',
|
|
|
|
'single',
|
2023-03-20 20:49:22 +08:00
|
|
|
{ avoidEscape: true, allowTemplateLiterals: false },
|
2020-12-04 21:15:41 +08:00
|
|
|
],
|
2021-07-06 02:01:15 +08:00
|
|
|
'jest/no-done-callback': 'off',
|
2020-12-04 21:15:41 +08:00
|
|
|
curly: ['error', 'all'],
|
|
|
|
eqeqeq: 'error',
|
2023-03-20 20:49:22 +08:00
|
|
|
'prefer-arrow-callback': 'error',
|
2020-12-04 21:15:41 +08:00
|
|
|
},
|
|
|
|
settings: {
|
|
|
|
react: {
|
2023-03-20 20:49:22 +08:00
|
|
|
version: 'detect',
|
|
|
|
},
|
|
|
|
},
|
2020-12-04 21:15:41 +08:00
|
|
|
};
|