-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
eslint.config.mjs
58 lines (54 loc) · 1.47 KB
/
eslint.config.mjs
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
// https://www.npmjs.com/package/@eslint/eslintrc
import * as eslintCompat from '@eslint/compat';
import * as eslintRc from '@eslint/eslintrc';
import js from '@eslint/js';
import path from 'node:path';
import url from 'node:url';
const baseDir = path.dirname(url.fileURLToPath(import.meta.url));
const compat = new eslintRc.FlatCompat({
allConfig: js.configs.all,
// optional unless you're using "eslint:recommended"
baseDirectory: baseDir,
// optional
recommendedConfig: js.configs.recommended,
// optional; default: process.cwd()
resolvePluginsRelativeTo: baseDir, // optional unless you're using "eslint:all"
});
export default eslintCompat.fixupConfigRules([
...compat.config({
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/eslint-recommended', 'plugin:prettier/recommended'],
plugins: ['@typescript-eslint', 'prettier'],
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
'@typescript-eslint/explicit-function-return-type': [0],
'@typescript-eslint/no-use-before-define': [0],
'prettier/prettier': 'error',
},
env: {
browser: true,
node: true,
jest: true,
es6: true,
},
root: true,
}),
{
ignores: [
'.git/',
'.github/',
'.idea/',
'coverage/',
'dist/',
'docs/',
'lint/',
'node_modules/',
'*.DS_Store',
'*.lock',
'*.log',
],
},
]);