-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheslint.config.mjs
More file actions
61 lines (58 loc) · 1.73 KB
/
Copy patheslint.config.mjs
File metadata and controls
61 lines (58 loc) · 1.73 KB
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
import {FlatCompat} from '@eslint/eslintrc';
import js from '@eslint/js';
import {fileURLToPath} from 'url';
import {dirname} from 'path';
import mochaPlugin from 'eslint-plugin-mocha';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
resolvePluginsRelativeTo: __dirname,
recommendedConfig: js.configs.recommended
});
export default [
{
files: ['**/*.ts', '**/*.tsx'],
ignores: ['.yarn', '.vscode', '.github', 'node_modules']
},
...compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
// Prettier plugin and recommended rules
'plugin:prettier/recommended'
),
// Import mocha plugin directly (ES module)
mochaPlugin.configs.recommended,
...compat.plugins('eslint-plugin-local-rules'),
...compat.config({
root: true,
parser: '@typescript-eslint/parser',
rules: {
// Include .prettierrc.js rules
'prettier/prettier': ['error', {}, {usePrettierrc: true}],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
indent: ['error', 2, {SwitchCase: 1}],
quotes: ['error', 'single'],
semi: ['error', 'always'],
'no-console': 'off',
'linebreak-style': ['error', 'unix'],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-var-requires': 'off',
'local-rules/log-manager': 'error'
},
env: {
browser: true,
node: true,
commonjs: true,
mocha: true
},
settings: {
react: {
version: 'detect'
}
}
})
];