@ver0/oxlint-config 2.0.0 → 2.0.2
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/README.md +38 -7
- package/configs/browser-globals.d.ts +7 -0
- package/configs/browser.d.ts +5 -0
- package/configs/javascript.d.ts +5 -0
- package/configs/node.d.ts +5 -0
- package/configs/react.d.ts +5 -0
- package/configs/typescript.d.ts +10 -0
- package/configs/typescript.js +5 -0
- package/configs/vitest.d.ts +5 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -84,15 +84,16 @@ export default defineConfig({
|
|
|
84
84
|
|
|
85
85
|
## 📦 Available Configs
|
|
86
86
|
|
|
87
|
-
Each config is a standalone module
|
|
88
|
-
no per-config
|
|
87
|
+
Each config is a standalone module; oxlint lints JS and TS uniformly, so modules apply to all lintable files (only
|
|
88
|
+
the vitest module scopes itself to test files). Import to enable, skip to disable — no options, no per-config
|
|
89
|
+
dependencies.
|
|
89
90
|
|
|
90
|
-
- **JavaScript** (`javascript.js`) — base rules
|
|
91
|
-
|
|
91
|
+
- **JavaScript** (`javascript.js`) — base rules: ESLint core plus `unicorn`, `import`, `promise` and `oxc` rules.
|
|
92
|
+
Always include this one — other configs build on top of it.
|
|
92
93
|
|
|
93
|
-
- **TypeScript** (`typescript.js`) —
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
- **TypeScript** (`typescript.js`) — `typescript` plugin rules with type-aware linting — see
|
|
95
|
+
[Type-aware linting](#type-aware-linting). Also exports `typescriptUnsafe` to disable strict `no-unsafe-*`
|
|
96
|
+
type-safety rules:
|
|
96
97
|
|
|
97
98
|
```ts
|
|
98
99
|
import typescript, {typescriptUnsafe} from '@ver0/oxlint-config/typescript.js';
|
|
@@ -191,3 +192,33 @@ export default defineConfig({
|
|
|
191
192
|
},
|
|
192
193
|
});
|
|
193
194
|
```
|
|
195
|
+
|
|
196
|
+
**Your `overrides` losing to the presets?** oxlint merges a consumer's top-level `overrides` _before_ the extended
|
|
197
|
+
configs, so preset overrides (e.g. vitest's plugin enablement for test files) win. Compose your own overrides as the
|
|
198
|
+
last `extends` entry instead — and note that rules of a plugin enabled only inside an override (like `vitest/*`) are
|
|
199
|
+
silently ignored in your override unless it redeclares the plugin:
|
|
200
|
+
|
|
201
|
+
```ts
|
|
202
|
+
// oxlint.config.ts
|
|
203
|
+
import {defineConfig} from 'oxlint';
|
|
204
|
+
import javascript from '@ver0/oxlint-config/javascript.js';
|
|
205
|
+
import vitest from '@ver0/oxlint-config/vitest.js';
|
|
206
|
+
|
|
207
|
+
export default defineConfig({
|
|
208
|
+
extends: [
|
|
209
|
+
javascript,
|
|
210
|
+
vitest,
|
|
211
|
+
{
|
|
212
|
+
overrides: [
|
|
213
|
+
{
|
|
214
|
+
files: ['**/*.test.*'],
|
|
215
|
+
plugins: ['vitest'],
|
|
216
|
+
rules: {
|
|
217
|
+
'vitest/no-disabled-tests': 'off',
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
});
|
|
224
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type {OxlintConfig} from 'oxlint';
|
|
2
|
+
|
|
3
|
+
declare const typescript: OxlintConfig;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Disables strict type-safety rules for projects where they are too noisy.
|
|
7
|
+
*/
|
|
8
|
+
export declare const typescriptUnsafe: OxlintConfig;
|
|
9
|
+
|
|
10
|
+
export default typescript;
|
package/configs/typescript.js
CHANGED
|
@@ -11,6 +11,11 @@ const typescript = {
|
|
|
11
11
|
typeAware: true,
|
|
12
12
|
},
|
|
13
13
|
rules: {
|
|
14
|
+
// typescript/require-await (type-aware) supersedes it and exempts
|
|
15
|
+
// promise-returning bodies; with the base rule on, promise-function-async
|
|
16
|
+
// + return-await leave no compliant shape for `async fn() { return promise; }`.
|
|
17
|
+
'require-await': 'off',
|
|
18
|
+
|
|
14
19
|
'typescript/adjacent-overload-signatures': 'error',
|
|
15
20
|
'typescript/array-type': [
|
|
16
21
|
'error',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ver0/oxlint-config",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Oxlint configs used in all ver0 projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"conventional-changelog-conventionalcommits": "^10.2.1",
|
|
37
37
|
"oxlint": "^1.75.0",
|
|
38
38
|
"semantic-release": "^25.0.8",
|
|
39
|
+
"typescript": "^7.0.2",
|
|
39
40
|
"vite-plus": "^0.2.5",
|
|
40
41
|
"vitest": "^4.1.10"
|
|
41
42
|
},
|
|
@@ -47,5 +48,5 @@
|
|
|
47
48
|
"optional": true
|
|
48
49
|
}
|
|
49
50
|
},
|
|
50
|
-
"packageManager": "yarn@4.
|
|
51
|
+
"packageManager": "yarn@4.17.1"
|
|
51
52
|
}
|