-
-
Notifications
You must be signed in to change notification settings - Fork 67
/
eslint.config.mjs
53 lines (52 loc) · 1.43 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
import pluginJs from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import prettierPlugin from 'eslint-plugin-prettier';
import pluginSimpleImportSort from 'eslint-plugin-simple-import-sort';
import globals from 'globals';
import tseslint from 'typescript-eslint';
/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
plugins: {
'@typescript-eslint': tseslint.plugin,
'simple-import-sort': pluginSimpleImportSort,
prettier: prettierPlugin,
},
},
{
files: ['**/*.{js,mjs,cjs,ts}'],
},
{
ignores: ['node_modules', 'next', 'demo/build', 'package/dist'],
},
{
languageOptions: {
globals: {
...globals.node,
...globals.browser,
...globals.es2021,
},
parserOptions: {
project: ['tsconfig.json'],
},
},
},
{
rules: {
...prettierPlugin.configs.recommended.rules,
...eslintConfigPrettier.rules,
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'no-extra-boolean-cast': 'off',
'arrow-parens': ['error', 'always'],
'simple-import-sort/imports': [
'error',
{
groups: [['^antd'], ['^@?\\w'], ['~/(.*)', '@/(.*)'], ['^[./]']],
},
],
},
},
];