oxlint-config-awesomeness 3.1.0 → 3.2.0
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/bin/template.ts +5 -0
- package/index.js +35 -1
- package/package.json +3 -3
package/bin/template.ts
CHANGED
package/index.js
CHANGED
|
@@ -105,6 +105,8 @@ export default defineConfig({
|
|
|
105
105
|
"@typescript-eslint/no-unsafe-call": "off",
|
|
106
106
|
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
107
107
|
"@typescript-eslint/no-unsafe-return": "off",
|
|
108
|
+
// Same rationale: casting mock/fixture data is routine in tests.
|
|
109
|
+
"@typescript-eslint/no-unsafe-type-assertion": "off",
|
|
108
110
|
// Legacy `var x = require(...)` still appears in older test setups.
|
|
109
111
|
"@typescript-eslint/no-var-requires": "off",
|
|
110
112
|
// Mock implementations may return bare promises without `async`.
|
|
@@ -147,6 +149,8 @@ export default defineConfig({
|
|
|
147
149
|
files: ["**/bin/**", "scripts/**"],
|
|
148
150
|
rules: {
|
|
149
151
|
"no-console": "off",
|
|
152
|
+
// One-shot CLI tools run sequentially; sync fs is the simpler, correct choice.
|
|
153
|
+
"node/no-sync": "off",
|
|
150
154
|
"unicorn/no-process-exit": "off",
|
|
151
155
|
},
|
|
152
156
|
},
|
|
@@ -167,6 +171,9 @@ export default defineConfig({
|
|
|
167
171
|
rules: {
|
|
168
172
|
// Tool configs are traditionally `export default {...}` with no name.
|
|
169
173
|
"import-x/no-anonymous-default-export": "off",
|
|
174
|
+
// Config files branch on optional env vars (`if (process.env.CI)`);
|
|
175
|
+
// spelling out the nullish/empty cases there is ceremony, not safety.
|
|
176
|
+
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
170
177
|
// Big configs (webpack, next) routinely exceed 400 lines.
|
|
171
178
|
"max-lines": "off",
|
|
172
179
|
},
|
|
@@ -175,6 +182,17 @@ export default defineConfig({
|
|
|
175
182
|
{
|
|
176
183
|
files: ["**/e2e/**/fixtures/**", "**/e2e/**/*.ts"],
|
|
177
184
|
rules: {
|
|
185
|
+
// E2E helpers parse untyped external payloads (webhooks, test inboxes);
|
|
186
|
+
// the unsafe-`any` family and assertion rules are mock-data noise here,
|
|
187
|
+
// matching the unit-test override above.
|
|
188
|
+
"@typescript-eslint/no-unsafe-argument": "off",
|
|
189
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
190
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
|
191
|
+
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
192
|
+
"@typescript-eslint/no-unsafe-return": "off",
|
|
193
|
+
"@typescript-eslint/no-unsafe-type-assertion": "off",
|
|
194
|
+
// Harness code branches on optional env vars (`if (process.env.CI)`).
|
|
195
|
+
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
178
196
|
// Playwright fixtures use hook-like names (`test.extend`) that trip the rule.
|
|
179
197
|
"react-hooks/rules-of-hooks": "off",
|
|
180
198
|
},
|
|
@@ -302,14 +320,30 @@ export default defineConfig({
|
|
|
302
320
|
"@typescript-eslint/no-require-imports": "error",
|
|
303
321
|
"@typescript-eslint/no-var-requires": "error",
|
|
304
322
|
// Promise-returning functions must be `async` — guarantees thrown errors become rejections.
|
|
305
|
-
"@typescript-eslint/promise-function-async": "error",
|
|
323
|
+
"@typescript-eslint/promise-function-async": ["error", { checkArrowFunctions: false }],
|
|
306
324
|
// `.catch((err) => ...)` — `err` should be `unknown`, not `any` (strict TS behavior).
|
|
307
325
|
"@typescript-eslint/use-unknown-in-catch-callback-variable": "error",
|
|
308
326
|
|
|
327
|
+
// Type-aware (tsgolint) tuning. These rules only run when the consuming
|
|
328
|
+
// repo enables `options.typeAware`; configuring them here is a no-op otherwise.
|
|
329
|
+
|
|
330
|
+
// Requires `Readonly<>` on virtually every object/array parameter and fights
|
|
331
|
+
// React, Playwright, and Hono signatures. Upstream keeps it out of every preset.
|
|
332
|
+
"@typescript-eslint/prefer-readonly-parameter-types": "off",
|
|
333
|
+
// Fires on idiomatic destructuring of library hooks (`const { push } = useRouter()`)
|
|
334
|
+
// because their types lack `this: void` annotations; false positives dominate.
|
|
335
|
+
"@typescript-eslint/unbound-method": "off",
|
|
336
|
+
|
|
309
337
|
// Restriction — React
|
|
310
338
|
|
|
311
339
|
// `<button>` defaults to `type="submit"` — silently submits enclosing forms. Must be explicit.
|
|
312
340
|
"react/button-has-type": "error",
|
|
341
|
+
// Arrow components (`const X = () =>`) are the fleet standard; the rule's
|
|
342
|
+
// default demands `function` declarations, so pin it to arrows explicitly.
|
|
343
|
+
"react/function-component-definition": [
|
|
344
|
+
"error",
|
|
345
|
+
{ namedComponents: "arrow-function", unnamedComponents: "arrow-function" },
|
|
346
|
+
],
|
|
313
347
|
// Raw HTML insertion in JSX is an XSS vector — require a deliberate opt-out.
|
|
314
348
|
"react/no-danger": "error",
|
|
315
349
|
// Catches typos like `class=` or `tabindex=` in JSX.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint-config-awesomeness",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Oxlint config with sensible defaults.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"autofix",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"husky": "^9.1.7",
|
|
43
43
|
"lint-staged": "^17.0.7",
|
|
44
44
|
"oxfmt": "^0.52.0",
|
|
45
|
-
"oxlint": "^1.
|
|
45
|
+
"oxlint": "^1.75.0",
|
|
46
46
|
"vitest": "^4.1.8"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"oxlint": ">=1.
|
|
49
|
+
"oxlint": ">=1.75.0 <2.0.0"
|
|
50
50
|
},
|
|
51
51
|
"lint-staged": {
|
|
52
52
|
"!(*.d).{ts,tsx,mts,cts,js,jsx,mjs,cjs}": [
|