-
Notifications
You must be signed in to change notification settings - Fork 11
/
eslint.config.mjs
38 lines (36 loc) · 1.23 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
import Js from '@eslint/js';
import PluginImport from 'eslint-plugin-import';
import Ts from 'typescript-eslint';
// NOTE Some plugins have yet to properly migrate to being compatible with the
// flat configuration machinery. We probably want them back once they're
// compatible again.
//
// - eslint-plugin-jsx-a11y
// - eslint-plugin-react
// - eslint-plugin-react-hooks
// - next/core-web-vitals
export default [
...[
Js.configs.recommended,
...Ts.configs.strict,
...Ts.configs.stylistic,
{
plugins: { import: PluginImport },
rules: {
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', ignoreRestSiblings: true },
],
'import/consistent-type-specifier-style': ['error', 'prefer-inline'],
'no-console': ['error', { allow: ['error', 'warn'] }],
},
},
].map((it) => ({
files: ['{components,hooks,pages,scryfall,theme,tools}/**/*.{ts,tsx}'],
languageOptions: { parser: Ts.parser },
...it,
})),
];