@ver0/oxlint-config 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 ver0
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,73 @@
1
+ <div align="center">
2
+
3
+ # @ver0/oxlint-config
4
+
5
+ <p>
6
+ <a href="https://www.npmjs.com/package/@ver0/oxlint-config"><img alt="npm" src="https://img.shields.io/npm/v/%40ver0%2Foxlint-config"/></a>
7
+ <a href="https://github.com/ver0-project/oxlint-config/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/ver0-project/oxlint-config/actions/workflows/ci.yml/badge.svg"/></a>
8
+ </p>
9
+
10
+ <p>🦀 Shared <a href="https://oxc.rs/docs/guide/usage/linter">Oxlint</a> configs used in all ver0 projects.</p>
11
+
12
+ </div>
13
+
14
+ The oxlint counterpart of [`@ver0/eslint-config`](https://github.com/ver0-project/eslint-config) for the VoidZero
15
+ stack (Vite+, Oxc). Rule sets are ported from the ESLint configs (XO-based) with everything mapped to oxlint's native
16
+ Rust implementations — no JS plugins, no plugin peer dependencies.
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ vp add -D @ver0/oxlint-config
22
+ ```
23
+
24
+ The `oxlint` package itself is optional — Vite+ (`vp lint`) ships the linter; standalone usage requires it.
25
+
26
+ ## Usage
27
+
28
+ Shared configs are consumed via `oxlint.config.ts` (or the `lint` block of `vite.config.ts` in Vite+ projects) — the
29
+ JSON config format (`.oxlintrc.json`) does not resolve npm packages in `extends`. Pick the modules matching the
30
+ project:
31
+
32
+ ```ts
33
+ import {defineConfig} from 'oxlint';
34
+ import javascript from '@ver0/oxlint-config/javascript.js';
35
+ import typescript from '@ver0/oxlint-config/typescript.js';
36
+ import node from '@ver0/oxlint-config/node.js';
37
+ import vitest from '@ver0/oxlint-config/vitest.js';
38
+
39
+ export default defineConfig({
40
+ extends: [javascript, typescript, node, vitest],
41
+ });
42
+ ```
43
+
44
+ ## Configs
45
+
46
+ | Module | Applies to | Contents |
47
+ | --------------- | ---------- | ---------------------------------------------------------------------- |
48
+ | `javascript.js` | `*.js(x)` | ESLint core + `unicorn`, `import`, `promise` rules |
49
+ | `typescript.js` | `*.ts(x)` | JS rule set + `typescript` rules, type-aware rules included |
50
+ | `react.js` | JS + TS | `react` and `react-hooks` rules |
51
+ | `node.js` | JS + TS | Node.js environment, globals and `node` rules (ESM flavor) |
52
+ | `browser.js` | JS + TS | Browser environment plus `no-restricted-globals` for confusing globals |
53
+ | `vitest.js` | `*.test.*` | `vitest` plugin rules for test files |
54
+
55
+ `typescript.js` additionally exports `typescriptUnsafe` that disables strict `no-unsafe-*` type-safety rules.
56
+
57
+ ### Type-aware linting
58
+
59
+ `typescript.js` enables `typeAware` and includes rules that need type information. They require
60
+ [`oxlint-tsgolint`](https://github.com/oxc-project/tsgolint):
61
+
62
+ ```bash
63
+ vp add -D oxlint-tsgolint
64
+ ```
65
+
66
+ Without it, disable type-aware mode in the consuming config: `options: {typeAware: false}`.
67
+
68
+ ## Scope
69
+
70
+ This package covers only what oxlint lints natively. Svelte template rules, JSON and Markdown linting stay with
71
+ [`@ver0/eslint-config`](https://github.com/ver0-project/eslint-config) — oxlint only lints `<script>` blocks of
72
+ `.svelte` files. Formatting is [oxfmt](https://oxc.rs/docs/guide/usage/formatter)'s job — stylistic rules are
73
+ deliberately absent.
@@ -0,0 +1,86 @@
1
+ import {GLOBS} from '../utils/globs.js';
2
+
3
+ /** @type {import('oxlint').OxlintConfig} */
4
+ const browser = {
5
+ plugins: [],
6
+ categories: {
7
+ correctness: 'off',
8
+ },
9
+ env: {
10
+ builtin: true,
11
+ },
12
+ overrides: [
13
+ {
14
+ files: [GLOBS.JS, GLOBS.TS],
15
+ rules: {
16
+ 'no-restricted-globals': [
17
+ 'error',
18
+ 'addEventListener',
19
+ 'blur',
20
+ 'close',
21
+ 'closed',
22
+ 'confirm',
23
+ 'defaultStatus',
24
+ 'defaultstatus',
25
+ 'event',
26
+ 'external',
27
+ 'find',
28
+ 'focus',
29
+ 'frameElement',
30
+ 'frames',
31
+ 'history',
32
+ 'innerHeight',
33
+ 'innerWidth',
34
+ 'length',
35
+ 'location',
36
+ 'locationbar',
37
+ 'menubar',
38
+ 'moveBy',
39
+ 'moveTo',
40
+ 'name',
41
+ 'onblur',
42
+ 'onerror',
43
+ 'onfocus',
44
+ 'onload',
45
+ 'onresize',
46
+ 'onunload',
47
+ 'open',
48
+ 'opener',
49
+ 'opera',
50
+ 'outerHeight',
51
+ 'outerWidth',
52
+ 'pageXOffset',
53
+ 'pageYOffset',
54
+ 'parent',
55
+ 'print',
56
+ 'removeEventListener',
57
+ 'resizeBy',
58
+ 'resizeTo',
59
+ 'screen',
60
+ 'screenLeft',
61
+ 'screenTop',
62
+ 'screenX',
63
+ 'screenY',
64
+ 'scroll',
65
+ 'scrollbars',
66
+ 'scrollBy',
67
+ 'scrollTo',
68
+ 'scrollX',
69
+ 'scrollY',
70
+ 'self',
71
+ 'status',
72
+ 'statusbar',
73
+ 'stop',
74
+ 'toolbar',
75
+ 'top',
76
+ ],
77
+ },
78
+ env: {
79
+ browser: true,
80
+ es2026: true,
81
+ },
82
+ },
83
+ ],
84
+ };
85
+
86
+ export default browser;
@@ -0,0 +1,263 @@
1
+ import {GLOBS} from '../utils/globs.js';
2
+
3
+ /** @type {import('oxlint').OxlintConfig} */
4
+ const javascript = {
5
+ plugins: [],
6
+ categories: {
7
+ correctness: 'off',
8
+ },
9
+ env: {
10
+ builtin: true,
11
+ },
12
+ overrides: [
13
+ {
14
+ files: [GLOBS.JS],
15
+ rules: {
16
+ 'constructor-super': 'error',
17
+ 'for-direction': 'error',
18
+ 'getter-return': 'error',
19
+ 'no-async-promise-executor': 'error',
20
+ 'no-case-declarations': 'error',
21
+ 'no-class-assign': 'error',
22
+ 'no-compare-neg-zero': 'error',
23
+ 'no-cond-assign': 'error',
24
+ 'no-const-assign': 'error',
25
+ 'no-constant-binary-expression': 'error',
26
+ 'no-constant-condition': 'error',
27
+ 'no-control-regex': 'error',
28
+ 'no-debugger': 'error',
29
+ 'no-delete-var': 'error',
30
+ 'no-dupe-class-members': 'error',
31
+ 'no-dupe-else-if': 'error',
32
+ 'no-dupe-keys': 'error',
33
+ 'no-duplicate-case': 'error',
34
+ 'no-empty': 'error',
35
+ 'no-empty-character-class': 'error',
36
+ 'no-empty-pattern': 'error',
37
+ 'no-empty-static-block': 'error',
38
+ 'no-ex-assign': 'error',
39
+ 'no-extra-boolean-cast': 'error',
40
+ 'no-fallthrough': 'error',
41
+ 'no-func-assign': 'error',
42
+ 'no-global-assign': 'error',
43
+ 'no-import-assign': 'error',
44
+ 'no-invalid-regexp': 'error',
45
+ 'no-irregular-whitespace': 'error',
46
+ 'no-loss-of-precision': 'error',
47
+ 'no-misleading-character-class': 'error',
48
+ 'no-new-native-nonconstructor': 'error',
49
+ 'no-nonoctal-decimal-escape': 'error',
50
+ 'no-obj-calls': 'error',
51
+ 'no-prototype-builtins': 'error',
52
+ 'no-redeclare': 'error',
53
+ 'no-regex-spaces': 'error',
54
+ 'no-self-assign': 'error',
55
+ 'no-setter-return': 'error',
56
+ 'no-shadow-restricted-names': 'error',
57
+ 'no-sparse-arrays': 'error',
58
+ 'no-this-before-super': 'error',
59
+ 'no-unassigned-vars': 'error',
60
+ 'no-unexpected-multiline': 'error',
61
+ 'no-unreachable': 'error',
62
+ 'no-unsafe-finally': 'error',
63
+ 'no-unsafe-negation': 'error',
64
+ 'no-unsafe-optional-chaining': 'error',
65
+ 'no-unused-labels': 'error',
66
+ 'no-unused-private-class-members': 'error',
67
+ 'no-unused-vars': 'error',
68
+ 'no-useless-backreference': 'error',
69
+ 'no-useless-catch': 'error',
70
+ 'no-useless-escape': 'error',
71
+ 'no-with': 'error',
72
+ 'preserve-caught-error': 'error',
73
+ 'require-yield': 'error',
74
+ 'use-isnan': 'error',
75
+ 'valid-typeof': 'error',
76
+ 'import/namespace': 'error',
77
+ 'import/default': 'error',
78
+ 'import/no-named-as-default': 'error',
79
+ 'import/no-named-as-default-member': 'error',
80
+ 'import/no-duplicates': [
81
+ 'error',
82
+ {
83
+ 'prefer-inline': false,
84
+ },
85
+ ],
86
+ 'promise/always-return': 'error',
87
+ 'promise/no-return-wrap': [
88
+ 'error',
89
+ {
90
+ allowReject: true,
91
+ },
92
+ ],
93
+ 'promise/param-names': 'error',
94
+ 'promise/catch-or-return': 'error',
95
+ 'promise/no-nesting': 'warn',
96
+ 'promise/no-promise-in-callback': 'warn',
97
+ 'promise/no-callback-in-promise': 'warn',
98
+ 'promise/avoid-new': 'off',
99
+ 'promise/no-new-statics': 'error',
100
+ 'promise/valid-params': 'error',
101
+ 'no-negated-condition': 'off',
102
+ 'no-nested-ternary': 'off',
103
+ 'unicorn/catch-error-name': 'error',
104
+ 'unicorn/consistent-assert': 'error',
105
+ 'unicorn/consistent-date-clone': 'error',
106
+ 'unicorn/consistent-empty-array-spread': 'error',
107
+ 'unicorn/consistent-existence-index-check': 'error',
108
+ 'unicorn/consistent-function-scoping': 'off',
109
+ 'unicorn/consistent-template-literal-escape': 'error',
110
+ 'unicorn/custom-error-definition': 'off',
111
+ 'unicorn/empty-brace-spaces': 'error',
112
+ 'unicorn/error-message': 'error',
113
+ 'unicorn/escape-case': 'error',
114
+ 'unicorn/explicit-length-check': 'error',
115
+ 'unicorn/filename-case': 'error',
116
+ 'unicorn/import-style': 'error',
117
+ 'unicorn/new-for-builtins': 'error',
118
+ 'unicorn/no-abusive-eslint-disable': 'error',
119
+ 'unicorn/no-accessor-recursion': 'error',
120
+ 'unicorn/no-anonymous-default-export': 'error',
121
+ 'unicorn/no-array-callback-reference': 'error',
122
+ 'unicorn/no-array-fill-with-reference-type': 'error',
123
+ 'unicorn/no-array-for-each': 'error',
124
+ 'unicorn/no-array-method-this-argument': 'error',
125
+ 'unicorn/no-array-reduce': 'error',
126
+ 'unicorn/no-array-reverse': 'error',
127
+ 'unicorn/no-array-sort': 'error',
128
+ 'unicorn/no-await-expression-member': 'error',
129
+ 'unicorn/no-await-in-promise-methods': 'error',
130
+ 'unicorn/no-console-spaces': 'error',
131
+ 'unicorn/no-document-cookie': 'error',
132
+ 'unicorn/no-empty-file': 'error',
133
+ 'unicorn/no-hex-escape': 'error',
134
+ 'unicorn/no-immediate-mutation': 'error',
135
+ 'unicorn/no-instanceof-builtins': 'error',
136
+ 'unicorn/no-invalid-fetch-options': 'error',
137
+ 'unicorn/no-invalid-remove-event-listener': 'error',
138
+ 'unicorn/no-lonely-if': 'error',
139
+ 'unicorn/no-magic-array-flat-depth': 'error',
140
+ 'unicorn/no-negated-condition': 'error',
141
+ 'unicorn/no-negation-in-equality-check': 'error',
142
+ 'unicorn/no-nested-ternary': 'error',
143
+ 'unicorn/no-new-array': 'error',
144
+ 'unicorn/no-new-buffer': 'error',
145
+ 'unicorn/no-null': 'off',
146
+ 'unicorn/no-object-as-default-parameter': 'error',
147
+ 'unicorn/no-process-exit': 'error',
148
+ 'unicorn/no-single-promise-in-promise-methods': 'error',
149
+ 'unicorn/no-static-only-class': 'error',
150
+ 'unicorn/no-thenable': 'error',
151
+ 'unicorn/no-this-assignment': 'error',
152
+ 'unicorn/no-typeof-undefined': 'error',
153
+ 'unicorn/no-unnecessary-array-flat-depth': 'error',
154
+ 'unicorn/no-unnecessary-array-splice-count': 'error',
155
+ 'unicorn/no-unnecessary-await': 'error',
156
+ 'unicorn/no-unnecessary-slice-end': 'error',
157
+ 'unicorn/no-unreadable-array-destructuring': 'error',
158
+ 'unicorn/no-unreadable-iife': 'error',
159
+ 'unicorn/no-useless-collection-argument': 'error',
160
+ 'unicorn/no-useless-error-capture-stack-trace': 'error',
161
+ 'unicorn/no-useless-fallback-in-spread': 'error',
162
+ 'unicorn/no-useless-length-check': 'error',
163
+ 'unicorn/no-useless-promise-resolve-reject': 'error',
164
+ 'unicorn/no-useless-spread': 'error',
165
+ 'unicorn/no-useless-switch-case': 'error',
166
+ 'unicorn/no-useless-undefined': 'off',
167
+ 'unicorn/no-zero-fractions': 'error',
168
+ 'unicorn/number-literal-case': 'error',
169
+ 'unicorn/numeric-separators-style': 'error',
170
+ 'unicorn/prefer-add-event-listener': 'error',
171
+ 'unicorn/prefer-array-find': 'error',
172
+ 'unicorn/prefer-array-flat': 'error',
173
+ 'unicorn/prefer-array-flat-map': 'error',
174
+ 'unicorn/prefer-array-index-of': 'error',
175
+ 'unicorn/prefer-array-some': 'error',
176
+ 'unicorn/prefer-at': 'error',
177
+ 'unicorn/prefer-bigint-literals': 'error',
178
+ 'unicorn/prefer-blob-reading-methods': 'error',
179
+ 'unicorn/prefer-class-fields': 'error',
180
+ 'unicorn/prefer-classlist-toggle': 'error',
181
+ 'unicorn/prefer-code-point': 'error',
182
+ 'unicorn/prefer-date-now': 'error',
183
+ 'unicorn/prefer-default-parameters': 'error',
184
+ 'unicorn/prefer-dom-node-append': 'error',
185
+ 'unicorn/prefer-dom-node-remove': 'error',
186
+ 'unicorn/prefer-dom-node-text-content': 'error',
187
+ 'unicorn/prefer-event-target': 'error',
188
+ 'unicorn/prefer-export-from': 'error',
189
+ 'unicorn/prefer-global-this': 'error',
190
+ 'unicorn/prefer-import-meta-properties': 'off',
191
+ 'unicorn/prefer-includes': 'error',
192
+ 'unicorn/prefer-keyboard-event-key': 'error',
193
+ 'unicorn/prefer-logical-operator-over-ternary': 'error',
194
+ 'unicorn/prefer-math-min-max': 'error',
195
+ 'unicorn/prefer-math-trunc': 'error',
196
+ 'unicorn/prefer-modern-dom-apis': 'error',
197
+ 'unicorn/prefer-modern-math-apis': 'error',
198
+ 'unicorn/prefer-module': 'error',
199
+ 'unicorn/prefer-native-coercion-functions': 'error',
200
+ 'unicorn/prefer-negative-index': 'error',
201
+ 'unicorn/prefer-node-protocol': 'error',
202
+ 'unicorn/prefer-number-properties': 'error',
203
+ 'unicorn/prefer-object-from-entries': 'error',
204
+ 'unicorn/prefer-optional-catch-binding': 'error',
205
+ 'unicorn/prefer-prototype-methods': 'error',
206
+ 'unicorn/prefer-query-selector': 'error',
207
+ 'unicorn/prefer-reflect-apply': 'error',
208
+ 'unicorn/prefer-regexp-test': 'error',
209
+ 'unicorn/prefer-response-static-json': 'error',
210
+ 'unicorn/prefer-set-has': 'error',
211
+ 'unicorn/prefer-set-size': 'error',
212
+ 'unicorn/prefer-single-call': 'error',
213
+ 'unicorn/prefer-spread': 'error',
214
+ 'unicorn/prefer-string-raw': 'off',
215
+ 'unicorn/prefer-string-replace-all': 'error',
216
+ 'unicorn/prefer-string-slice': 'error',
217
+ 'unicorn/prefer-string-starts-ends-with': 'error',
218
+ 'unicorn/prefer-string-trim-start-end': 'error',
219
+ 'unicorn/prefer-structured-clone': 'error',
220
+ 'unicorn/prefer-ternary': 'off',
221
+ 'unicorn/prefer-top-level-await': 'error',
222
+ 'unicorn/prefer-type-error': 'error',
223
+ 'unicorn/relative-url-style': 'error',
224
+ 'unicorn/require-array-join-separator': 'error',
225
+ 'unicorn/require-module-attributes': 'error',
226
+ 'unicorn/require-module-specifiers': 'error',
227
+ 'unicorn/require-number-to-fixed-digits-argument': 'error',
228
+ 'unicorn/require-post-message-target-origin': 'off',
229
+ 'unicorn/switch-case-braces': 'error',
230
+ 'unicorn/switch-case-break-position': 'error',
231
+ 'unicorn/text-encoding-identifier-case': 'error',
232
+ 'unicorn/throw-new-error': 'error',
233
+ 'capitalized-comments': 'off',
234
+ 'import/first': 'error',
235
+ 'import/no-unassigned-import': 'off',
236
+ 'import/extensions': [
237
+ 'error',
238
+ 'always',
239
+ {
240
+ ignorePackages: true,
241
+ },
242
+ ],
243
+ 'import/no-absolute-path': 'error',
244
+ 'import/no-anonymous-default-export': 'off',
245
+ 'import/no-named-default': 'error',
246
+ 'import/no-webpack-loader-syntax': 'error',
247
+ 'import/no-self-import': 'error',
248
+ 'import/no-cycle': 'off',
249
+ 'import/newline-after-import': 'error',
250
+ 'import/no-amd': 'error',
251
+ 'import/no-empty-named-blocks': 'error',
252
+ 'import/no-mutable-exports': 'error',
253
+ 'promise/prefer-await-to-then': 'error',
254
+ },
255
+ plugins: ['import', 'promise', 'unicorn'],
256
+ env: {
257
+ es2026: true,
258
+ },
259
+ },
260
+ ],
261
+ };
262
+
263
+ export default javascript;
@@ -0,0 +1,43 @@
1
+ import {GLOBS} from '../utils/globs.js';
2
+
3
+ /** @type {import('oxlint').OxlintConfig} */
4
+ const node = {
5
+ plugins: [],
6
+ categories: {
7
+ correctness: 'off',
8
+ },
9
+ env: {
10
+ builtin: true,
11
+ },
12
+ overrides: [
13
+ {
14
+ files: [GLOBS.JS, GLOBS.TS],
15
+ rules: {
16
+ 'node/no-exports-assign': 'error',
17
+ 'node/no-mixed-requires': [
18
+ 'error',
19
+ {
20
+ grouping: true,
21
+ allowCall: true,
22
+ },
23
+ ],
24
+ 'node/no-new-require': 'error',
25
+ 'node/no-path-concat': 'error',
26
+ },
27
+ globals: {
28
+ __dirname: 'off',
29
+ __filename: 'off',
30
+ exports: 'off',
31
+ module: 'off',
32
+ require: 'off',
33
+ },
34
+ plugins: ['node'],
35
+ env: {
36
+ es2026: true,
37
+ node: true,
38
+ },
39
+ },
40
+ ],
41
+ };
42
+
43
+ export default node;
@@ -0,0 +1,117 @@
1
+ import {GLOBS} from '../utils/globs.js';
2
+
3
+ /** @type {import('oxlint').OxlintConfig} */
4
+ const react = {
5
+ plugins: [],
6
+ categories: {
7
+ correctness: 'off',
8
+ },
9
+ env: {
10
+ builtin: true,
11
+ },
12
+ overrides: [
13
+ {
14
+ files: [GLOBS.JS, GLOBS.TS],
15
+ rules: {
16
+ 'react/button-has-type': 'error',
17
+ 'react/checked-requires-onchange-or-readonly': 'error',
18
+ 'react/forward-ref-uses-ref': 'error',
19
+ 'react/function-component-definition': [
20
+ 'error',
21
+ {
22
+ namedComponents: 'function-declaration',
23
+ unnamedComponents: 'arrow-function',
24
+ },
25
+ ],
26
+ 'react/hook-use-state': [
27
+ 'error',
28
+ {
29
+ allowDestructuredState: true,
30
+ },
31
+ ],
32
+ 'react/iframe-missing-sandbox': 'error',
33
+ 'react/no-array-index-key': 'error',
34
+ 'react/no-children-prop': 'error',
35
+ 'react/no-danger': 'error',
36
+ 'react/no-danger-with-children': 'error',
37
+ 'react/no-did-update-set-state': 'error',
38
+ 'react/no-direct-mutation-state': 'error',
39
+ 'react/no-find-dom-node': 'error',
40
+ 'react/no-is-mounted': 'error',
41
+ 'react/no-namespace': 'error',
42
+ 'react/no-object-type-as-default-prop': 'error',
43
+ 'react/no-redundant-should-component-update': 'error',
44
+ 'react/no-render-return-value': 'error',
45
+ 'react/no-string-refs': [
46
+ 'error',
47
+ {
48
+ noTemplateLiterals: true,
49
+ },
50
+ ],
51
+ 'react/no-this-in-sfc': 'error',
52
+ 'react/no-unescaped-entities': 'error',
53
+ 'react/no-unknown-property': [
54
+ 'error',
55
+ {
56
+ requireDataLowercase: true,
57
+ },
58
+ ],
59
+ 'react/no-unsafe': 'error',
60
+ 'react/react-in-jsx-scope': 'off',
61
+ 'react/self-closing-comp': 'error',
62
+ 'react/state-in-constructor': ['error', 'never'],
63
+ 'react/style-prop-object': [
64
+ 'error',
65
+ {
66
+ allow: ['FormattedNumber'],
67
+ },
68
+ ],
69
+ 'react/void-dom-elements-no-children': 'error',
70
+ 'react/jsx-boolean-value': 'error',
71
+ 'react/jsx-key': [
72
+ 'error',
73
+ {
74
+ checkFragmentShorthand: true,
75
+ checkKeyMustBeforeSpread: true,
76
+ warnOnDuplicates: true,
77
+ },
78
+ ],
79
+ 'react/jsx-no-comment-textnodes': 'error',
80
+ 'react/jsx-no-constructed-context-values': 'error',
81
+ 'react/jsx-no-duplicate-props': 'error',
82
+ 'react/jsx-no-script-url': [
83
+ 'error',
84
+ {
85
+ includeFromSettings: true,
86
+ },
87
+ ],
88
+ 'react/jsx-no-target-blank': [
89
+ 'error',
90
+ {
91
+ warnOnSpreadAttributes: true,
92
+ forms: true,
93
+ },
94
+ ],
95
+ 'react/jsx-no-undef': 'error',
96
+ 'react/jsx-no-useless-fragment': 'error',
97
+ 'react/jsx-curly-brace-presence': [
98
+ 'error',
99
+ {
100
+ props: 'never',
101
+ children: 'never',
102
+ propElementValues: 'always',
103
+ },
104
+ ],
105
+ 'react/jsx-fragments': ['error', 'syntax'],
106
+ 'react/jsx-pascal-case': 'error',
107
+ 'react/jsx-props-no-spread-multi': 'error',
108
+ 'react/rules-of-hooks': 'error',
109
+ 'react/exhaustive-deps': 'warn',
110
+ 'react/display-name': 'off',
111
+ },
112
+ plugins: ['react'],
113
+ },
114
+ ],
115
+ };
116
+
117
+ export default react;
@@ -0,0 +1,517 @@
1
+ import {GLOBS} from '../utils/globs.js';
2
+
3
+ /** @type {import('oxlint').OxlintConfig} */
4
+ const typescript = {
5
+ plugins: [],
6
+ categories: {
7
+ correctness: 'off',
8
+ },
9
+ options: {
10
+ typeAware: true,
11
+ },
12
+ env: {
13
+ builtin: true,
14
+ },
15
+ overrides: [
16
+ {
17
+ files: [GLOBS.TS],
18
+ rules: {
19
+ 'constructor-super': 'error',
20
+ 'for-direction': 'error',
21
+ 'getter-return': 'error',
22
+ 'no-async-promise-executor': 'error',
23
+ 'no-case-declarations': 'error',
24
+ 'no-class-assign': 'error',
25
+ 'no-compare-neg-zero': 'error',
26
+ 'no-cond-assign': 'error',
27
+ 'no-const-assign': 'error',
28
+ 'no-constant-binary-expression': 'error',
29
+ 'no-constant-condition': 'error',
30
+ 'no-control-regex': 'error',
31
+ 'no-debugger': 'error',
32
+ 'no-delete-var': 'error',
33
+ 'no-dupe-class-members': 'error',
34
+ 'no-dupe-else-if': 'error',
35
+ 'no-dupe-keys': 'error',
36
+ 'no-duplicate-case': 'error',
37
+ 'no-empty': 'error',
38
+ 'no-empty-character-class': 'error',
39
+ 'no-empty-pattern': 'error',
40
+ 'no-empty-static-block': 'error',
41
+ 'no-ex-assign': 'error',
42
+ 'no-extra-boolean-cast': 'error',
43
+ 'no-fallthrough': 'error',
44
+ 'no-func-assign': 'error',
45
+ 'no-global-assign': 'error',
46
+ 'no-import-assign': 'error',
47
+ 'no-invalid-regexp': 'error',
48
+ 'no-irregular-whitespace': 'error',
49
+ 'no-loss-of-precision': 'error',
50
+ 'no-misleading-character-class': 'error',
51
+ 'no-new-native-nonconstructor': 'error',
52
+ 'no-nonoctal-decimal-escape': 'error',
53
+ 'no-obj-calls': 'error',
54
+ 'no-prototype-builtins': 'error',
55
+ 'no-redeclare': 'error',
56
+ 'no-regex-spaces': 'error',
57
+ 'no-self-assign': 'error',
58
+ 'no-setter-return': 'error',
59
+ 'no-shadow-restricted-names': 'error',
60
+ 'no-sparse-arrays': 'error',
61
+ 'no-this-before-super': 'error',
62
+ 'no-unassigned-vars': 'error',
63
+ 'no-unexpected-multiline': 'error',
64
+ 'no-unreachable': 'error',
65
+ 'no-unsafe-finally': 'error',
66
+ 'no-unsafe-negation': 'error',
67
+ 'no-unsafe-optional-chaining': 'error',
68
+ 'no-unused-labels': 'error',
69
+ 'no-unused-private-class-members': 'off',
70
+ 'no-unused-vars': 'off',
71
+ 'no-useless-backreference': 'error',
72
+ 'no-useless-catch': 'error',
73
+ 'no-useless-escape': 'error',
74
+ 'no-with': 'error',
75
+ 'preserve-caught-error': 'error',
76
+ 'require-yield': 'error',
77
+ 'use-isnan': 'error',
78
+ 'valid-typeof': 'error',
79
+ 'import/namespace': 'off',
80
+ 'import/default': 'error',
81
+ 'import/no-named-as-default': 'error',
82
+ 'import/no-named-as-default-member': 'error',
83
+ 'import/no-duplicates': [
84
+ 'error',
85
+ {
86
+ 'prefer-inline': false,
87
+ },
88
+ ],
89
+ 'promise/always-return': 'error',
90
+ 'promise/no-return-wrap': [
91
+ 'error',
92
+ {
93
+ allowReject: true,
94
+ },
95
+ ],
96
+ 'promise/param-names': 'error',
97
+ 'promise/catch-or-return': 'error',
98
+ 'promise/no-nesting': 'warn',
99
+ 'promise/no-promise-in-callback': 'warn',
100
+ 'promise/no-callback-in-promise': 'warn',
101
+ 'promise/avoid-new': 'off',
102
+ 'promise/no-new-statics': 'error',
103
+ 'promise/valid-params': 'error',
104
+ 'no-negated-condition': 'off',
105
+ 'no-nested-ternary': 'off',
106
+ 'unicorn/catch-error-name': 'error',
107
+ 'unicorn/consistent-assert': 'error',
108
+ 'unicorn/consistent-date-clone': 'error',
109
+ 'unicorn/consistent-empty-array-spread': 'error',
110
+ 'unicorn/consistent-existence-index-check': 'error',
111
+ 'unicorn/consistent-function-scoping': 'off',
112
+ 'unicorn/consistent-template-literal-escape': 'error',
113
+ 'unicorn/custom-error-definition': 'off',
114
+ 'unicorn/empty-brace-spaces': 'error',
115
+ 'unicorn/error-message': 'error',
116
+ 'unicorn/escape-case': 'error',
117
+ 'unicorn/explicit-length-check': 'error',
118
+ 'unicorn/filename-case': 'error',
119
+ 'unicorn/import-style': 'error',
120
+ 'unicorn/new-for-builtins': 'error',
121
+ 'unicorn/no-abusive-eslint-disable': 'error',
122
+ 'unicorn/no-accessor-recursion': 'error',
123
+ 'unicorn/no-anonymous-default-export': 'error',
124
+ 'unicorn/no-array-callback-reference': 'error',
125
+ 'unicorn/no-array-fill-with-reference-type': 'error',
126
+ 'unicorn/no-array-for-each': 'error',
127
+ 'unicorn/no-array-method-this-argument': 'error',
128
+ 'unicorn/no-array-reduce': 'error',
129
+ 'unicorn/no-array-reverse': 'error',
130
+ 'unicorn/no-array-sort': 'error',
131
+ 'unicorn/no-await-expression-member': 'error',
132
+ 'unicorn/no-await-in-promise-methods': 'error',
133
+ 'unicorn/no-console-spaces': 'error',
134
+ 'unicorn/no-document-cookie': 'error',
135
+ 'unicorn/no-empty-file': 'error',
136
+ 'unicorn/no-hex-escape': 'error',
137
+ 'unicorn/no-immediate-mutation': 'error',
138
+ 'unicorn/no-instanceof-builtins': 'error',
139
+ 'unicorn/no-invalid-fetch-options': 'error',
140
+ 'unicorn/no-invalid-remove-event-listener': 'error',
141
+ 'unicorn/no-lonely-if': 'error',
142
+ 'unicorn/no-magic-array-flat-depth': 'error',
143
+ 'unicorn/no-negated-condition': 'error',
144
+ 'unicorn/no-negation-in-equality-check': 'error',
145
+ 'unicorn/no-nested-ternary': 'error',
146
+ 'unicorn/no-new-array': 'error',
147
+ 'unicorn/no-new-buffer': 'error',
148
+ 'unicorn/no-null': 'off',
149
+ 'unicorn/no-object-as-default-parameter': 'error',
150
+ 'unicorn/no-process-exit': 'error',
151
+ 'unicorn/no-single-promise-in-promise-methods': 'error',
152
+ 'unicorn/no-static-only-class': 'error',
153
+ 'unicorn/no-thenable': 'error',
154
+ 'unicorn/no-this-assignment': 'error',
155
+ 'unicorn/no-typeof-undefined': 'error',
156
+ 'unicorn/no-unnecessary-array-flat-depth': 'error',
157
+ 'unicorn/no-unnecessary-array-splice-count': 'error',
158
+ 'unicorn/no-unnecessary-await': 'error',
159
+ 'unicorn/no-unnecessary-slice-end': 'error',
160
+ 'unicorn/no-unreadable-array-destructuring': 'error',
161
+ 'unicorn/no-unreadable-iife': 'error',
162
+ 'unicorn/no-useless-collection-argument': 'error',
163
+ 'unicorn/no-useless-error-capture-stack-trace': 'error',
164
+ 'unicorn/no-useless-fallback-in-spread': 'error',
165
+ 'unicorn/no-useless-length-check': 'error',
166
+ 'unicorn/no-useless-promise-resolve-reject': 'error',
167
+ 'unicorn/no-useless-spread': 'error',
168
+ 'unicorn/no-useless-switch-case': 'error',
169
+ 'unicorn/no-useless-undefined': 'off',
170
+ 'unicorn/no-zero-fractions': 'error',
171
+ 'unicorn/number-literal-case': 'error',
172
+ 'unicorn/numeric-separators-style': 'error',
173
+ 'unicorn/prefer-add-event-listener': 'error',
174
+ 'unicorn/prefer-array-find': 'error',
175
+ 'unicorn/prefer-array-flat': 'error',
176
+ 'unicorn/prefer-array-flat-map': 'error',
177
+ 'unicorn/prefer-array-index-of': 'error',
178
+ 'unicorn/prefer-array-some': 'error',
179
+ 'unicorn/prefer-at': 'error',
180
+ 'unicorn/prefer-bigint-literals': 'error',
181
+ 'unicorn/prefer-blob-reading-methods': 'error',
182
+ 'unicorn/prefer-class-fields': 'error',
183
+ 'unicorn/prefer-classlist-toggle': 'error',
184
+ 'unicorn/prefer-code-point': 'error',
185
+ 'unicorn/prefer-date-now': 'error',
186
+ 'unicorn/prefer-default-parameters': 'error',
187
+ 'unicorn/prefer-dom-node-append': 'error',
188
+ 'unicorn/prefer-dom-node-remove': 'error',
189
+ 'unicorn/prefer-dom-node-text-content': 'error',
190
+ 'unicorn/prefer-event-target': 'error',
191
+ 'unicorn/prefer-export-from': 'error',
192
+ 'unicorn/prefer-global-this': 'error',
193
+ 'unicorn/prefer-import-meta-properties': 'off',
194
+ 'unicorn/prefer-includes': 'error',
195
+ 'unicorn/prefer-keyboard-event-key': 'error',
196
+ 'unicorn/prefer-logical-operator-over-ternary': 'error',
197
+ 'unicorn/prefer-math-min-max': 'error',
198
+ 'unicorn/prefer-math-trunc': 'error',
199
+ 'unicorn/prefer-modern-dom-apis': 'error',
200
+ 'unicorn/prefer-modern-math-apis': 'error',
201
+ 'unicorn/prefer-module': 'error',
202
+ 'unicorn/prefer-native-coercion-functions': 'error',
203
+ 'unicorn/prefer-negative-index': 'error',
204
+ 'unicorn/prefer-node-protocol': 'error',
205
+ 'unicorn/prefer-number-properties': 'error',
206
+ 'unicorn/prefer-object-from-entries': 'error',
207
+ 'unicorn/prefer-optional-catch-binding': 'error',
208
+ 'unicorn/prefer-prototype-methods': 'error',
209
+ 'unicorn/prefer-query-selector': 'error',
210
+ 'unicorn/prefer-reflect-apply': 'error',
211
+ 'unicorn/prefer-regexp-test': 'error',
212
+ 'unicorn/prefer-response-static-json': 'error',
213
+ 'unicorn/prefer-set-has': 'error',
214
+ 'unicorn/prefer-set-size': 'error',
215
+ 'unicorn/prefer-single-call': 'error',
216
+ 'unicorn/prefer-spread': 'error',
217
+ 'unicorn/prefer-string-raw': 'off',
218
+ 'unicorn/prefer-string-replace-all': 'error',
219
+ 'unicorn/prefer-string-slice': 'error',
220
+ 'unicorn/prefer-string-starts-ends-with': 'error',
221
+ 'unicorn/prefer-string-trim-start-end': 'error',
222
+ 'unicorn/prefer-structured-clone': 'error',
223
+ 'unicorn/prefer-ternary': 'off',
224
+ 'unicorn/prefer-top-level-await': 'error',
225
+ 'unicorn/prefer-type-error': 'error',
226
+ 'unicorn/relative-url-style': 'error',
227
+ 'unicorn/require-array-join-separator': 'error',
228
+ 'unicorn/require-module-attributes': 'error',
229
+ 'unicorn/require-module-specifiers': 'error',
230
+ 'unicorn/require-number-to-fixed-digits-argument': 'error',
231
+ 'unicorn/require-post-message-target-origin': 'off',
232
+ 'unicorn/switch-case-braces': 'error',
233
+ 'unicorn/switch-case-break-position': 'error',
234
+ 'unicorn/text-encoding-identifier-case': 'error',
235
+ 'unicorn/throw-new-error': 'error',
236
+ 'default-param-last': 'error',
237
+ 'no-array-constructor': 'error',
238
+ 'no-empty-function': 'error',
239
+ 'no-loop-func': 'error',
240
+ 'no-void': [
241
+ 'error',
242
+ {
243
+ allowAsStatement: true,
244
+ },
245
+ ],
246
+ 'no-restricted-imports': [
247
+ 'error',
248
+ {
249
+ paths: ['error', 'domain', 'freelist', 'smalloc', 'punycode', 'sys', 'querystring', 'colors'],
250
+ },
251
+ ],
252
+ 'no-throw-literal': 'off',
253
+ 'no-unused-expressions': 'error',
254
+ 'no-useless-constructor': 'error',
255
+ 'prefer-promise-reject-errors': 'off',
256
+ 'default-case': 'off',
257
+ 'no-duplicate-imports': 'off',
258
+ 'typescript/adjacent-overload-signatures': 'error',
259
+ 'typescript/array-type': [
260
+ 'error',
261
+ {
262
+ default: 'array-simple',
263
+ },
264
+ ],
265
+ 'typescript/await-thenable': 'error',
266
+ 'typescript/ban-ts-comment': [
267
+ 'error',
268
+ {
269
+ 'ts-expect-error': 'allow-with-description',
270
+ minimumDescriptionLength: 4,
271
+ },
272
+ ],
273
+ 'typescript/ban-tslint-comment': 'error',
274
+ 'typescript/no-restricted-types': [
275
+ 'error',
276
+ {
277
+ types: {
278
+ object: {
279
+ message:
280
+ 'The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848',
281
+ fixWith: 'Record<string, unknown>',
282
+ },
283
+ Buffer: {
284
+ message: 'Use Uint8Array instead. See: https://sindresorhus.com/blog/goodbye-nodejs-buffer',
285
+ suggest: ['Uint8Array'],
286
+ },
287
+ '[]': "Don't use the empty array type `[]`. It only allows empty arrays. Use `SomeType[]` instead.",
288
+ '[[]]':
289
+ "Don't use `[[]]`. It only allows an array with a single element which is an empty array. Use `SomeType[][]` instead.",
290
+ '[[[]]]': "Don't use `[[[]]]`. Use `SomeType[][][]` instead.",
291
+ '[[[[]]]]': 'ur drunk 🤡',
292
+ '[[[[[]]]]]': '🦄💥',
293
+ },
294
+ },
295
+ ],
296
+ 'typescript/class-literal-property-style': ['error', 'getters'],
297
+ 'typescript/consistent-generic-constructors': ['error', 'constructor'],
298
+ 'typescript/consistent-indexed-object-style': 'error',
299
+ 'typescript/dot-notation': 'error',
300
+ 'typescript/consistent-type-assertions': [
301
+ 'error',
302
+ {
303
+ assertionStyle: 'as',
304
+ objectLiteralTypeAssertions: 'allow-as-parameter',
305
+ },
306
+ ],
307
+ 'typescript/consistent-type-definitions': ['error', 'type'],
308
+ 'typescript/consistent-type-exports': [
309
+ 'error',
310
+ {
311
+ fixMixedExportsWithInlineTypeSpecifier: true,
312
+ },
313
+ ],
314
+ 'typescript/consistent-type-imports': [
315
+ 'error',
316
+ {
317
+ fixStyle: 'inline-type-imports',
318
+ },
319
+ ],
320
+ 'typescript/no-base-to-string': 'error',
321
+ 'typescript/no-array-delete': 'error',
322
+ 'typescript/no-confusing-void-expression': 'error',
323
+ 'typescript/no-deprecated': 'error',
324
+ 'typescript/no-duplicate-enum-values': 'error',
325
+ 'typescript/no-duplicate-type-constituents': 'error',
326
+ 'typescript/no-dynamic-delete': 'error',
327
+ 'typescript/no-empty-interface': [
328
+ 'error',
329
+ {
330
+ allowSingleExtends: true,
331
+ },
332
+ ],
333
+ 'typescript/no-empty-object-type': 'error',
334
+ 'typescript/no-extra-non-null-assertion': 'error',
335
+ 'typescript/no-extraneous-class': [
336
+ 'error',
337
+ {
338
+ allowConstructorOnly: false,
339
+ allowEmpty: false,
340
+ allowStaticOnly: false,
341
+ allowWithDecorator: true,
342
+ },
343
+ ],
344
+ 'typescript/no-floating-promises': [
345
+ 'error',
346
+ {
347
+ checkThenables: true,
348
+ ignoreVoid: true,
349
+ ignoreIIFE: true,
350
+ },
351
+ ],
352
+ 'typescript/no-for-in-array': 'error',
353
+ 'typescript/no-inferrable-types': 'error',
354
+ 'typescript/no-meaningless-void-operator': 'error',
355
+ 'typescript/no-misused-new': 'error',
356
+ 'typescript/no-misused-promises': [
357
+ 'error',
358
+ {
359
+ checksConditionals: true,
360
+ checksVoidReturn: false,
361
+ },
362
+ ],
363
+ 'typescript/no-namespace': 'error',
364
+ 'typescript/no-non-null-asserted-nullish-coalescing': 'error',
365
+ 'typescript/no-non-null-asserted-optional-chain': 'error',
366
+ 'typescript/no-require-imports': 'error',
367
+ 'typescript/no-this-alias': [
368
+ 'error',
369
+ {
370
+ allowDestructuring: true,
371
+ },
372
+ ],
373
+ 'typescript/only-throw-error': [
374
+ 'error',
375
+ {
376
+ allowThrowingUnknown: true,
377
+ allowThrowingAny: false,
378
+ },
379
+ ],
380
+ 'typescript/no-unnecessary-boolean-literal-compare': 'error',
381
+ 'typescript/no-unnecessary-qualifier': 'error',
382
+ 'typescript/no-unnecessary-type-arguments': 'error',
383
+ 'typescript/no-unnecessary-type-assertion': 'error',
384
+ 'typescript/no-unnecessary-type-constraint': 'error',
385
+ 'typescript/no-unsafe-argument': 'error',
386
+ 'typescript/no-unsafe-assignment': 'error',
387
+ 'typescript/no-unsafe-call': 'error',
388
+ 'typescript/no-unsafe-declaration-merging': 'error',
389
+ 'typescript/no-unsafe-enum-comparison': 'error',
390
+ 'typescript/no-unsafe-function-type': 'error',
391
+ 'typescript/no-unsafe-member-access': 'error',
392
+ 'typescript/no-unsafe-return': 'error',
393
+ 'typescript/no-unsafe-type-assertion': 'error',
394
+ 'typescript/no-useless-empty-export': 'error',
395
+ 'typescript/no-useless-default-assignment': 'error',
396
+ 'typescript/no-wrapper-object-types': 'error',
397
+ 'typescript/non-nullable-type-assertion-style': 'error',
398
+ 'typescript/prefer-as-const': 'error',
399
+ 'typescript/prefer-find': 'error',
400
+ 'typescript/prefer-for-of': 'error',
401
+ 'typescript/prefer-function-type': 'error',
402
+ 'typescript/prefer-includes': 'error',
403
+ 'typescript/prefer-literal-enum-member': 'error',
404
+ 'typescript/prefer-namespace-keyword': 'error',
405
+ 'typescript/prefer-nullish-coalescing': [
406
+ 'error',
407
+ {
408
+ ignoreTernaryTests: false,
409
+ ignoreConditionalTests: false,
410
+ ignoreMixedLogicalExpressions: false,
411
+ },
412
+ ],
413
+ 'typescript/prefer-promise-reject-errors': 'error',
414
+ 'typescript/prefer-readonly': 'error',
415
+ 'typescript/prefer-reduce-type-parameter': 'error',
416
+ 'typescript/prefer-string-starts-ends-with': 'error',
417
+ 'typescript/promise-function-async': 'error',
418
+ 'typescript/related-getter-setter-pairs': 'error',
419
+ 'typescript/restrict-plus-operands': [
420
+ 'error',
421
+ {
422
+ allowAny: false,
423
+ },
424
+ ],
425
+ 'typescript/restrict-template-expressions': [
426
+ 'error',
427
+ {
428
+ allowNumber: true,
429
+ },
430
+ ],
431
+ 'typescript/return-await': 'error',
432
+ 'typescript/require-array-sort-compare': [
433
+ 'error',
434
+ {
435
+ ignoreStringArrays: true,
436
+ },
437
+ ],
438
+ 'typescript/strict-void-return': 'error',
439
+ 'typescript/switch-exhaustiveness-check': [
440
+ 'error',
441
+ {
442
+ allowDefaultCaseForExhaustiveSwitch: false,
443
+ requireDefaultForNonUnion: true,
444
+ },
445
+ ],
446
+ 'typescript/triple-slash-reference': [
447
+ 'error',
448
+ {
449
+ path: 'never',
450
+ types: 'never',
451
+ lib: 'never',
452
+ },
453
+ ],
454
+ 'typescript/prefer-regexp-exec': 'error',
455
+ 'typescript/prefer-return-this-type': 'error',
456
+ 'typescript/unified-signatures': [
457
+ 'error',
458
+ {
459
+ ignoreDifferentlyNamedParameters: true,
460
+ },
461
+ ],
462
+ 'typescript/use-unknown-in-catch-callback-variable': 'error',
463
+ 'capitalized-comments': 'off',
464
+ 'import/first': 'error',
465
+ 'import/no-unassigned-import': 'off',
466
+ 'import/extensions': [
467
+ 'error',
468
+ 'always',
469
+ {
470
+ ignorePackages: true,
471
+ },
472
+ ],
473
+ 'import/no-absolute-path': 'error',
474
+ 'import/no-anonymous-default-export': 'off',
475
+ 'import/no-named-default': 'error',
476
+ 'import/no-webpack-loader-syntax': 'error',
477
+ 'import/no-self-import': 'error',
478
+ 'import/no-cycle': 'off',
479
+ 'import/newline-after-import': 'error',
480
+ 'import/no-amd': 'error',
481
+ 'import/no-empty-named-blocks': 'error',
482
+ 'import/no-mutable-exports': 'error',
483
+ 'promise/prefer-await-to-then': 'error',
484
+ 'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
485
+ },
486
+ plugins: ['import', 'promise', 'unicorn', 'typescript'],
487
+ env: {
488
+ es2026: true,
489
+ },
490
+ },
491
+ ],
492
+ };
493
+
494
+ /**
495
+ * Disables strict type-safety rules for projects where they are too noisy.
496
+ *
497
+ * @type {import('oxlint').OxlintConfig}
498
+ */
499
+ export const typescriptUnsafe = {
500
+ overrides: [
501
+ {
502
+ files: [GLOBS.TS],
503
+ rules: {
504
+ 'typescript/no-unsafe-argument': 'off',
505
+ 'typescript/no-unsafe-assignment': 'off',
506
+ 'typescript/no-unsafe-call': 'off',
507
+ 'typescript/no-unsafe-declaration-merging': 'off',
508
+ 'typescript/no-unsafe-enum-comparison': 'off',
509
+ 'typescript/no-unsafe-member-access': 'off',
510
+ 'typescript/no-unsafe-return': 'off',
511
+ 'typescript/no-unsafe-type-assertion': 'off',
512
+ },
513
+ },
514
+ ],
515
+ };
516
+
517
+ export default typescript;
@@ -0,0 +1,39 @@
1
+ import {GLOBS} from '../utils/globs.js';
2
+
3
+ /** @type {import('oxlint').OxlintConfig} */
4
+ const vitest = {
5
+ plugins: [],
6
+ categories: {
7
+ correctness: 'off',
8
+ },
9
+ env: {
10
+ builtin: true,
11
+ },
12
+ overrides: [
13
+ {
14
+ files: [GLOBS.TEST],
15
+ rules: {
16
+ 'vitest/expect-expect': 'error',
17
+ 'vitest/no-commented-out-tests': 'error',
18
+ 'vitest/no-conditional-expect': 'error',
19
+ 'vitest/no-disabled-tests': 'warn',
20
+ 'vitest/no-focused-tests': 'error',
21
+ 'vitest/no-identical-title': 'error',
22
+ 'vitest/no-import-node-test': 'error',
23
+ 'vitest/no-interpolation-in-snapshots': 'error',
24
+ 'vitest/no-mocks-import': 'error',
25
+ 'vitest/no-standalone-expect': 'error',
26
+ 'vitest/no-unneeded-async-expect-function': 'error',
27
+ 'vitest/prefer-called-exactly-once-with': 'error',
28
+ 'vitest/require-local-test-context-for-concurrent-snapshots': 'error',
29
+ 'vitest/valid-describe-callback': 'error',
30
+ 'vitest/valid-expect': 'error',
31
+ 'vitest/valid-expect-in-promise': 'error',
32
+ 'vitest/valid-title': 'error',
33
+ },
34
+ plugins: ['vitest'],
35
+ },
36
+ ],
37
+ };
38
+
39
+ export default vitest;
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@ver0/oxlint-config",
3
+ "version": "0.0.1",
4
+ "description": "Oxlint configs used in all ver0 projects",
5
+ "keywords": [
6
+ "config",
7
+ "oxc",
8
+ "oxlint",
9
+ "react",
10
+ "typescript",
11
+ "vitest"
12
+ ],
13
+ "bugs": {
14
+ "url": "https://github.com/ver0-project/oxlint-config/issues"
15
+ },
16
+ "license": "MIT",
17
+ "author": "Anton Zinovyev <xog3@yandex.ru>",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/ver0-project/oxlint-config"
21
+ },
22
+ "type": "module",
23
+ "exports": {
24
+ "./*": "./configs/*"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "scripts": {
30
+ "lint": "vp lint",
31
+ "lint:fix": "vp lint --fix",
32
+ "fmt": "vp fmt --write",
33
+ "test": "vp test"
34
+ },
35
+ "devDependencies": {
36
+ "oxlint": "^1.75.0",
37
+ "semantic-release": "^25.0.8",
38
+ "vite-plus": "^0.2.5",
39
+ "vitest": "^4.1.10"
40
+ },
41
+ "peerDependencies": {
42
+ "oxlint": "^1.75.0"
43
+ },
44
+ "peerDependenciesMeta": {
45
+ "oxlint": {
46
+ "optional": true
47
+ }
48
+ },
49
+ "packageManager": "yarn@4.12.0"
50
+ }
package/utils/globs.js ADDED
@@ -0,0 +1,5 @@
1
+ export const GLOBS = {
2
+ JS: '**/*.{js,jsx,mjs,cjs}',
3
+ TS: '**/*.{ts,tsx,mts,cts}',
4
+ TEST: '**/*.{test,benchmark}.*',
5
+ };