-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoxlint.config.ts
More file actions
117 lines (116 loc) · 2.77 KB
/
Copy pathoxlint.config.ts
File metadata and controls
117 lines (116 loc) · 2.77 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import { defineConfig } from 'oxlint';
export default defineConfig({
ignorePatterns: [
'dist',
'node_modules',
'bun.lock',
'**/*.tsbuildinfo',
'**/autoImports.d.ts',
'**/paraglide/**',
'**/*.gen.ts',
],
env: {
browser: true,
es2022: true,
},
plugins: ['eslint', 'typescript', 'unicorn', 'oxc'],
categories: {
correctness: 'error',
suspicious: 'error',
perf: 'error',
pedantic: 'error',
style: 'warn',
restriction: 'warn',
},
rules: {
'sort-keys': 'off',
'sort-imports': 'off',
'no-debugger': 'error',
'no-alert': 'error',
'no-console': 'error',
'no-eval': 'error',
eqeqeq: ['error', 'always'],
'typescript/no-explicit-any': 'error',
'typescript/no-non-null-assertion': 'error',
'typescript/consistent-type-imports': 'error',
'typescript/consistent-type-definitions': ['error', 'type'],
'typescript/prefer-readonly-parameter-types': 'off',
'require-unicode-regexp': 'off',
'typescript/strict-void-return': 'off',
'typescript/no-unnecessary-type-parameters': 'off',
'typescript/explicit-member-accessibility': 'off',
'func-name-matching': 'off',
'id-length': ['error', { exceptions: ['_', 'm'] }],
'no-unused-vars': [
'error',
{
vars: 'all',
args: 'after-used',
ignoreRestSiblings: true,
},
],
'oxc/bad-comparison-sequence': 'error',
'oxc/bad-object-literal-comparison': 'error',
'oxc/bad-replace-all-arg': 'error',
'oxc/const-comparisons': 'error',
'oxc/uninvoked-array-callback': 'error',
'oxc/no-rest-spread-properties': 'off',
'typescript/no-misused-spread': 'off',
'no-magic-numbers': ['warn', { ignore: [0, 1] }],
'no-ternary': 'off',
'unicorn/no-null': 'off',
'unicorn/filename-case': ['error', { case: 'camelCase' }],
'func-style': [
'error',
'expression',
{
allowArrowFunctions: true,
},
],
'typescript/consistent-return': 'off',
'typescript/promise-function-async': 'off',
'no-useless-return': 'off',
},
overrides: [
{
files: ['*.{config}.ts'],
env: {
node: true,
},
},
{
files: ['**/*.tsx'],
rules: {
'unicorn/filename-case': [
'error',
{
case: 'pascalCase',
},
],
},
},
{
files: ['src/main.tsx'],
rules: {
'unicorn/filename-case': 'off',
},
},
{
files: ['src/routes/**/*.tsx'],
rules: {
'unicorn/filename-case': [
'error',
{
case: 'kebabCase',
ignore: ['^__root$', '^index$'],
},
],
},
},
],
options: {
denyWarnings: true,
typeAware: true,
typeCheck: true,
},
});