Skip to content

Commit 2fba8b6

Browse files
committed
feat: add oxlint configuration for TypeScript and JavaScript
1 parent 57eb5bf commit 2fba8b6

File tree

2 files changed

+199
-68
lines changed

2 files changed

+199
-68
lines changed

.oxlintrc.json

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"plugins": ["typescript"],
4+
"categories": {
5+
"correctness": "off"
6+
},
7+
"env": {
8+
"builtin": true
9+
},
10+
"ignorePatterns": [
11+
"node_modules",
12+
"dist",
13+
"build",
14+
".content-collections",
15+
".tanstack-start",
16+
".netlify",
17+
"public",
18+
"convex/.temp"
19+
],
20+
"rules": {
21+
"no-array-constructor": "error",
22+
"no-unused-expressions": "error",
23+
"no-unused-vars": "error",
24+
"typescript/ban-ts-comment": "error",
25+
"typescript/no-duplicate-enum-values": "error",
26+
"typescript/no-empty-object-type": "error",
27+
"typescript/no-explicit-any": "error",
28+
"typescript/no-extra-non-null-assertion": "error",
29+
"typescript/no-misused-new": "error",
30+
"typescript/no-namespace": "error",
31+
"typescript/no-non-null-asserted-optional-chain": "error",
32+
"typescript/no-require-imports": "error",
33+
"typescript/no-this-alias": "error",
34+
"typescript/no-unnecessary-type-constraint": "error",
35+
"typescript/no-unsafe-declaration-merging": "error",
36+
"typescript/no-unsafe-function-type": "error",
37+
"typescript/no-wrapper-object-types": "error",
38+
"typescript/prefer-as-const": "error",
39+
"typescript/prefer-namespace-keyword": "error",
40+
"typescript/triple-slash-reference": "error"
41+
},
42+
"overrides": [
43+
{
44+
"files": ["**/*.{js,jsx}"],
45+
"rules": {
46+
"constructor-super": "error",
47+
"for-direction": "error",
48+
"no-async-promise-executor": "error",
49+
"no-case-declarations": "error",
50+
"no-class-assign": "error",
51+
"no-compare-neg-zero": "error",
52+
"no-cond-assign": "error",
53+
"no-const-assign": "error",
54+
"no-constant-binary-expression": "error",
55+
"no-constant-condition": "error",
56+
"no-control-regex": "error",
57+
"no-debugger": "error",
58+
"no-delete-var": "error",
59+
"no-dupe-class-members": "error",
60+
"no-dupe-else-if": "error",
61+
"no-dupe-keys": "error",
62+
"no-duplicate-case": "error",
63+
"no-empty": "error",
64+
"no-empty-character-class": "error",
65+
"no-empty-pattern": "error",
66+
"no-empty-static-block": "error",
67+
"no-ex-assign": "error",
68+
"no-extra-boolean-cast": "error",
69+
"no-fallthrough": "error",
70+
"no-func-assign": "error",
71+
"no-global-assign": "error",
72+
"no-import-assign": "error",
73+
"no-invalid-regexp": "error",
74+
"no-irregular-whitespace": "error",
75+
"no-loss-of-precision": "error",
76+
"no-misleading-character-class": "error",
77+
"no-new-native-nonconstructor": "error",
78+
"no-nonoctal-decimal-escape": "error",
79+
"no-obj-calls": "error",
80+
"no-prototype-builtins": "error",
81+
"no-redeclare": "error",
82+
"no-regex-spaces": "error",
83+
"no-self-assign": "error",
84+
"no-setter-return": "error",
85+
"no-shadow-restricted-names": "error",
86+
"no-sparse-arrays": "error",
87+
"no-this-before-super": "error",
88+
"no-unexpected-multiline": "error",
89+
"no-unsafe-finally": "error",
90+
"no-unsafe-negation": "error",
91+
"no-unsafe-optional-chaining": "error",
92+
"no-unused-labels": "error",
93+
"no-unused-private-class-members": "error",
94+
"no-useless-backreference": "error",
95+
"no-useless-catch": "error",
96+
"no-useless-escape": "error",
97+
"no-with": "error",
98+
"require-yield": "error",
99+
"use-isnan": "error",
100+
"valid-typeof": "error"
101+
}
102+
},
103+
{
104+
"files": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
105+
"rules": {
106+
"constructor-super": "off",
107+
"no-class-assign": "off",
108+
"no-const-assign": "off",
109+
"no-dupe-class-members": "off",
110+
"no-dupe-keys": "off",
111+
"no-func-assign": "off",
112+
"no-import-assign": "off",
113+
"no-new-native-nonconstructor": "off",
114+
"no-obj-calls": "off",
115+
"no-redeclare": "off",
116+
"no-setter-return": "off",
117+
"no-this-before-super": "off",
118+
"no-unsafe-negation": "off",
119+
"no-var": "error",
120+
"no-with": "off",
121+
"prefer-const": "error",
122+
"prefer-rest-params": "error",
123+
"prefer-spread": "error"
124+
}
125+
},
126+
{
127+
"files": ["**/*.{ts,tsx}"],
128+
"rules": {
129+
"no-redeclare": "error",
130+
"no-shadow": "off",
131+
"no-unused-vars": [
132+
"warn",
133+
{
134+
"argsIgnorePattern": "(^_)|(^__+$)|(^e$)|(^error$)",
135+
"varsIgnorePattern": "(^_)|(^__+$)|(^e$)|(^error$)",
136+
"caughtErrorsIgnorePattern": "(^_)|(^__+$)|(^e$)|(^error$)"
137+
}
138+
],
139+
"typescript/no-explicit-any": "off"
140+
}
141+
},
142+
{
143+
"files": ["**/*.{ts,tsx,js,jsx}"],
144+
"rules": {
145+
"jsx-a11y/alt-text": "error",
146+
"jsx-a11y/anchor-ambiguous-text": "off",
147+
"jsx-a11y/anchor-has-content": "error",
148+
"jsx-a11y/anchor-is-valid": "error",
149+
"jsx-a11y/aria-activedescendant-has-tabindex": "error",
150+
"jsx-a11y/aria-props": "error",
151+
"jsx-a11y/aria-proptypes": "error",
152+
"jsx-a11y/aria-role": "error",
153+
"jsx-a11y/aria-unsupported-elements": "error",
154+
"jsx-a11y/autocomplete-valid": "error",
155+
"jsx-a11y/click-events-have-key-events": "error",
156+
"jsx-a11y/heading-has-content": "error",
157+
"jsx-a11y/html-has-lang": "error",
158+
"jsx-a11y/iframe-has-title": "error",
159+
"jsx-a11y/img-redundant-alt": "error",
160+
"jsx-a11y/label-has-associated-control": "error",
161+
"jsx-a11y/media-has-caption": "error",
162+
"jsx-a11y/mouse-events-have-key-events": "error",
163+
"jsx-a11y/no-access-key": "error",
164+
"jsx-a11y/no-autofocus": "error",
165+
"jsx-a11y/no-distracting-elements": "error",
166+
"jsx-a11y/no-noninteractive-tabindex": [
167+
"error",
168+
{
169+
"tags": [],
170+
"roles": ["tabpanel"],
171+
"allowExpressionValues": true
172+
}
173+
],
174+
"jsx-a11y/no-redundant-roles": "error",
175+
"jsx-a11y/no-static-element-interactions": [
176+
"error",
177+
{
178+
"allowExpressionValues": true,
179+
"handlers": [
180+
"onClick",
181+
"onMouseDown",
182+
"onMouseUp",
183+
"onKeyPress",
184+
"onKeyDown",
185+
"onKeyUp"
186+
]
187+
}
188+
],
189+
"jsx-a11y/role-has-required-aria-props": "error",
190+
"jsx-a11y/role-supports-aria-props": "error",
191+
"jsx-a11y/scope": "error",
192+
"jsx-a11y/tabindex-no-positive": "error",
193+
"react/rules-of-hooks": "error",
194+
"react/exhaustive-deps": "warn"
195+
},
196+
"plugins": ["react", "jsx-a11y"]
197+
}
198+
]
199+
}

eslint.config.mjs

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)