-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheslint.config.js
More file actions
91 lines (88 loc) · 2.37 KB
/
eslint.config.js
File metadata and controls
91 lines (88 loc) · 2.37 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// @ts-check
import eslint from '@eslint/js'
import react from '@eslint-react/eslint-plugin'
import { createTypeScriptImportResolver } from 'eslint-import-resolver-typescript'
import { importX } from 'eslint-plugin-import-x'
import * as reactHooks from 'eslint-plugin-react-hooks'
import * as regexp from 'eslint-plugin-regexp'
import { config, configs } from 'typescript-eslint'
import doom from '@alauda/doom/eslint'
export default config(
{
ignores: ['dist', 'lib', 'pyodide'],
},
...(await doom(new URL('docs', import.meta.url))),
eslint.configs.recommended,
importX.flatConfigs.recommended,
importX.flatConfigs.typescript,
react.configs.recommended,
reactHooks.configs['recommended-latest'],
regexp.configs['flat/recommended'],
{
files: ['**/*.{ts,tsx}'],
extends: [
configs.eslintRecommended,
configs.strictTypeChecked,
react.configs['recommended-type-checked'],
],
languageOptions: {
parserOptions: {
projectService: true,
},
},
rules: {
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/restrict-template-expressions': [
'error',
{ allowNumber: true },
],
},
},
{
files: ['**/*.mdx'],
rules: {
'react-hooks/rules-of-hooks': 'off',
},
},
{
settings: {
'import-x/resolver-next': createTypeScriptImportResolver(),
},
rules: {
'import-x/default': 'off',
'import-x/first': 'error',
'import-x/newline-after-import': 'error',
'import-x/no-duplicates': 'error',
'import-x/no-named-as-default-member': 'off',
'import-x/no-unresolved': [
'error',
{
ignore: [
'doom-@api-crdsMap',
'doom-@api-openapisMap',
'doom-@api-virtual',
'doom-@global-virtual',
'doom-@permission-functionResourcesMap',
'doom-@permission-roleTemplatesMap',
'virtual-runtime-config',
],
},
],
'import-x/namespace': 'off',
'import-x/order': [
'error',
{
alphabetize: {
order: 'asc',
},
named: {
types: 'types-first',
},
'newlines-between': 'always',
},
],
'prefer-const': ['error', { destructuring: 'all' }],
},
},
)