@clipboard-health/oxlint-config 1.26.2 → 1.26.4
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 +6 -0
- package/package.json +2 -2
- package/src/base.json +4 -0
package/README.md
CHANGED
|
@@ -211,6 +211,10 @@ The package includes:
|
|
|
211
211
|
|
|
212
212
|
`base.json` cannot hold comments, so the reasoning for non-obvious "off" entries lives here (audited against clipboard-health on oxlint 1.60, 2026-06-11):
|
|
213
213
|
|
|
214
|
+
- **`typescript/strict-void-return`**: TypeScript deliberately permits a value-returning function where a `void` callback is expected, because the caller discards the result. This supports ordinary `forEach` callbacks that call `Set.add`, `Map.set`, or `Array.push`, and callback APIs that return a synchronous handle. The rule rejects those valid uses; its `allowReturnAny` option only relaxes `any` returns. Keep `no-misused-promises` and `no-floating-promises` enabled for async misuse. TypeScript still rejects a value returned from a function explicitly declared to return `void`.
|
|
215
|
+
- **`typescript/no-unnecessary-template-expression`**: simplifying string expressions inside template literals is a style preference. Explicit string normalization and string-enum formatting are allowed. Keep `restrict-template-expressions` and `no-base-to-string` enabled to detect unsafe interpolation instead.
|
|
216
|
+
- **`typescript/no-unnecessary-type-conversion`**: removing `Number`, `String`, `Boolean`, or `.toString()` conversions based on a declared type is a style preference. At boundaries where runtime data does not match its declared type, removal can change the value or its type. Explicit coercion is allowed; it does not replace runtime schema validation or the unsafe-operation guards.
|
|
217
|
+
- **`typescript/no-invalid-void-type`**: valid completion APIs use generic calls such as `Promise.withResolvers<void>()` and `http.get<void>()`. Even with `allowInGenericTypeArguments: true`, the rule rejects call-expression type arguments; this restriction is inherited from typescript-eslint, rather than an Oxlint port difference. Changing these APIs to `undefined` can change their public signatures: a `void` resolver permits `resolve()` without an argument. Keep the other TypeScript correctness and unsafe-operation guards enabled.
|
|
214
218
|
- **`typescript/consistent-type-imports`**: oxlint's port is not `emitDecoratorMetadata`-aware (even type-aware with the flag in the tsconfig chain), so it flags NestJS constructor-injected classes as type-only. Applying its fix converts DI tokens to `import type`, which SWC erases from `design:paramtypes` metadata, breaking injection at runtime. Do not enable in NestJS repos until oxlint matches typescript-eslint's decorator handling.
|
|
215
219
|
- **`jest/no-confusing-set-timeout`** (jest preset): false-positive explosion — when a jest setup file calls `jest.setTimeout`, the rule flags spec files that contain no `setTimeout` call at all (265k diagnostics across 764 clean files). The vitest preset carries no `jest/*` keys at all: under oxlint ≥1.68 with only the vitest plugin enabled, `jest/*` config keys are silently ignored, and jest-plugin-only rules (such as this one and `jest/prefer-ending-with-an-expect`) cannot fire — `vitest/no-confusing-set-timeout` is not a registered rule name, so an "off" entry for it fails config parsing.
|
|
216
220
|
- **`import/no-named-as-default` / `import/no-named-as-default-member`**: low signal; they flag legitimate default-export import patterns far more often than real mistakes (870 hits, ~0 bugs).
|
|
@@ -228,4 +232,6 @@ The following were turned off after an audit of 13 consumer repos (repo-local `"
|
|
|
228
232
|
|
|
229
233
|
The same audit removed the explicit opt-ins for `typescript/array-type` and `unicorn/filename-case`. They are `style` rules, so the `style` category now keeps them off.
|
|
230
234
|
|
|
235
|
+
When adopting the callback and coercion defaults, first upgrade to a published release containing them, then remove redundant local `off` entries for `typescript/strict-void-return`, `typescript/no-unnecessary-template-expression`, and `typescript/no-unnecessary-type-conversion`. Repositories that require these stricter conventions can opt back in with local `error` overrides. Keep `no-misused-promises` and `no-floating-promises` enabled: allowing discarded synchronous results does not permit unhandled async failures. Keep `restrict-template-expressions` and `no-base-to-string` enabled for unsafe interpolation.
|
|
236
|
+
|
|
231
237
|
The test-file override in `base.json` disables the `typescript/no-unsafe-*` family, `unbound-method`, `no-non-null-assertion`, and `restrict-template-expressions` for test files: mocks, `expect.any`, and `createMock` make these rules ~90% noise in tests (mirrors the long-standing eslint-config override), while keeping them enforceable for production code.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clipboard-health/oxlint-config",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.4",
|
|
4
4
|
"description": "Shared Oxlint configuration for Clipboard Health repositories.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@clipboard-health/oxlint-plugin": "1.4.
|
|
23
|
+
"@clipboard-health/oxlint-plugin": "1.4.2"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"oxlint": ">=1.68.0",
|
package/src/base.json
CHANGED
|
@@ -97,6 +97,9 @@
|
|
|
97
97
|
"typescript/explicit-module-boundary-types": "off",
|
|
98
98
|
"typescript/no-extraneous-class": ["error", { "allowWithDecorator": true }],
|
|
99
99
|
"typescript/no-import-type-side-effects": "off",
|
|
100
|
+
"typescript/no-invalid-void-type": "off",
|
|
101
|
+
"typescript/no-unnecessary-template-expression": "off",
|
|
102
|
+
"typescript/no-unnecessary-type-conversion": "off",
|
|
100
103
|
"typescript/no-unnecessary-type-parameters": "off",
|
|
101
104
|
"typescript/parameter-properties": "off",
|
|
102
105
|
"typescript/prefer-readonly-parameter-types": "off",
|
|
@@ -106,6 +109,7 @@
|
|
|
106
109
|
"error",
|
|
107
110
|
{ "allowNullableBoolean": true, "allowNullableString": true }
|
|
108
111
|
],
|
|
112
|
+
"typescript/strict-void-return": "off",
|
|
109
113
|
"unicorn/consistent-function-scoping": "off",
|
|
110
114
|
"unicorn/import-style": "off",
|
|
111
115
|
"unicorn/no-array-callback-reference": "off",
|