-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
82 lines (76 loc) · 1.69 KB
/
eslint.config.js
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// @ts-check
// import js from '@eslint/js';
import stylisticPlugin from '@stylistic/eslint-plugin';
import ts from 'typescript-eslint';
const stylistic = stylisticPlugin.configs.customize({
flat: true,
quoteProps: 'as-needed',
semi: true,
});
// const ts2 = ts.config(
// ts.configs.strictTypeChecked,
// ts.configs.stylisticTypeChecked,
// {
// },
// );
// * | import('@stylistic/eslint-plugin')}
// * import('typescript-eslint').Config}
/**
* @type {import('eslint').Linter.FlatConfig[]}
*/
const config = [
{
ignores: [
'*',
'!**/*.{js,ts,tsx}',
'!src/',
'**/.next/**',
'**/*.d.ts',
'**/bin/**',
'**/coverage/**',
'**/dist/**',
'**/out/**',
],
},
{
files: [
'**/*.{js,ts,tsx}',
],
plugins: {
...stylistic.plugins,
},
rules: {
// ...js.configs.recommended.rules,
...stylistic.rules,
},
},
{
files: [
'**/*.{ts,tsx}',
],
languageOptions: {
...ts.configs.base.languageOptions,
parserOptions: {
/** @see {@link https://typescript-eslint.io/getting-started/typed-linting/monorepos/} */
project: [
'./tsconfig.json',
'./src/*/tsconfig.json',
],
// tsconfigRootDir: import.meta.dirname ?? '.',
},
},
plugins: {
...ts.configs.base.plugins,
},
rules: {
...ts.configs.strictTypeChecked[1].rules,
...ts.configs.strictTypeChecked[2].rules,
...ts.configs.stylisticTypeChecked[1].rules,
...ts.configs.stylisticTypeChecked[2].rules,
'@typescript-eslint/no-explicit-any': ['error', {
ignoreRestArgs: true,
}],
},
},
];
export default config;