-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patheslint.config.ts
More file actions
65 lines (63 loc) · 1.86 KB
/
eslint.config.ts
File metadata and controls
65 lines (63 loc) · 1.86 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
import eslint from '@eslint/js'
import oxlint from 'eslint-plugin-oxlint'
import perfectionist from 'eslint-plugin-perfectionist'
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
import { defineConfig } from 'eslint/config'
import tseslint from 'typescript-eslint'
const config = defineConfig(
eslint.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
eslintPluginUnicorn.configs.recommended,
perfectionist.configs['recommended-natural'],
{
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true,
},
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
sourceType: 'module',
},
},
{
rules: {
'object-shorthand': 'warn',
'perfectionist/sort-objects': [
'error',
{
type: 'unsorted',
useConfigurationIf: {
callingFunctionNamePattern: ['createRootRouteWithContext', 'createFileRoute'],
},
},
],
'prefer-template': 'warn',
'unicorn/prevent-abbreviations': 'off',
},
},
{
// To generate oxlint
rules: {
'import/no-duplicates': 'error',
// 'react/jsx-fragments': 'error',
// "@typescript-eslint/consistent-type-imports": "error",
'import/no-empty-named-blocks': 'error',
'react/button-has-type': 'error',
'react/jsx-boolean-value': 'error',
'react/jsx-curly-brace-presence': 'error',
'react/jsx-no-comment-textnodes': 'error',
'react/jsx-no-useless-fragment': 'error',
'react/no-array-index-key': 'error',
'react/no-danger': 'error',
'react/self-closing-comp': 'error',
},
},
{
ignores: ['dist/', 'src/api/', 'src/routeTree.gen.ts', 'src/comm/openapi/schema.d.ts'],
},
...oxlint.buildFromOxlintConfigFile('./.oxlintrc.json'),
)
export default config