oxlint-config-awesomeness 4.2.0 → 4.4.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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Opinionated Oxlint config for software houses that want all their apps to feel the same.
4
4
 
5
- **454 rules** across **15 plugins**. Built for full-stack TypeScript monorepos with React, Next.js, Hono, Prisma, and more.
5
+ **458 rules** across **15 plugins**. Built for full-stack TypeScript monorepos with React, Next.js, Hono, Prisma, and more.
6
6
 
7
7
  ## Installation
8
8
 
@@ -2307,20 +2307,6 @@ with (obj) {
2307
2307
  obj.foo = 1;
2308
2308
  ```
2309
2309
 
2310
- ### one-var
2311
-
2312
- Require one declaration per variable; never comma-combine declarations.
2313
-
2314
- ```js
2315
- // bad
2316
- const a = 1,
2317
- b = 2;
2318
-
2319
- // good
2320
- const a = 1;
2321
- const b = 2;
2322
- ```
2323
-
2324
2310
  ### operator-assignment
2325
2311
 
2326
2312
  Require shorthand operators where possible.
@@ -7969,6 +7955,22 @@ Sort object keys alphabetically, with partition-by-comment support.
7969
7955
 
7970
7956
  ## Other JS Plugin Rules
7971
7957
 
7958
+ ### @nkzw/require-use-effect-arguments
7959
+
7960
+ Require an explicit dependency array on `useEffect`. Omitting it runs the effect after every render — always a deliberate choice, never an omission; `react-hooks/exhaustive-deps` validates the array's contents but cannot require its presence.
7961
+
7962
+ ```tsx
7963
+ // bad
7964
+ useEffect(() => {
7965
+ subscribe(id);
7966
+ });
7967
+
7968
+ // good
7969
+ useEffect(() => {
7970
+ subscribe(id);
7971
+ }, [id]);
7972
+ ```
7973
+
7972
7974
  ### react-hooks/exhaustive-deps
7973
7975
 
7974
7976
  Verify the dependency array for React Hooks like `useEffect`, `useMemo`, and `useCallback` includes all referenced reactive values.
@@ -1,3 +1,4 @@
1
+ // @generated from src/awesomeness.ts — do not edit. Regenerate with `pnpm build`.
1
2
  import { definePlugin, defineRule } from "@oxlint/plugins";
2
3
 
3
4
  const MAX_LINES = 5;
package/bin/init.js CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ // @generated from src/init.ts — do not edit. Regenerate with `pnpm build`.
2
3
  import { constants, copyFileSync } from "node:fs";
3
4
  import { resolve } from "node:path";
4
5
  import { parseArgs } from "node:util";
package/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ // @generated from src/index.ts — do not edit. Regenerate with `pnpm build`.
1
2
  import type { OxlintConfig } from "oxlint";
2
3
 
3
4
  declare const config: OxlintConfig;
package/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ // @generated from src/index.ts — do not edit. Regenerate with `pnpm build`.
1
2
  import { defineConfig } from "oxlint";
2
3
 
3
4
  const UNSAFE_ANY_OFF = {
@@ -58,6 +59,7 @@ const config = defineConfig({
58
59
  },
59
60
  // JS-plugin bridge for ESLint plugins oxlint doesn't yet implement natively.
60
61
  jsPlugins: [
62
+ "@nkzw/eslint-plugin",
61
63
  "eslint-plugin-no-only-tests",
62
64
  "eslint-plugin-perfectionist",
63
65
  "eslint-plugin-unused-imports",
@@ -274,14 +276,17 @@ const config = defineConfig({
274
276
  // Prevent duplicate import statements but still allow separating type-only imports
275
277
  // from value imports (`import type { X } from 'x'; import { y } from 'x';`).
276
278
  "eslint/no-duplicate-imports": ["error", { allowSeparateTypeImports: true }],
279
+ // `_`-prefixed names are the convention for deliberately unused bindings
280
+ // (ignored destructure slots, unused callback params).
281
+ "no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
277
282
  // Require the `v` flag on regex literals — opts into Unicode-aware matching with set notation.
278
283
  "eslint/require-unicode-regexp": ["error", { requireFlag: "v" }],
279
284
  // Block `@nocommit` markers from reaching main — a hard stop for WIP code.
280
285
  "no-warning-comments": ["error", { terms: ["@nocommit"] }],
281
- // New in oxlint 1.78 under `style`, where its upstream default ("always")
282
- // demands comma-combined declarations. Pin to "never": one declaration per
283
- // variable, matching how the fleet already writes.
284
- "one-var": ["error", "never"],
286
+ // Lives in `style`, which we bulk-enable, so it needs an explicit "off" —
287
+ // deleting this line would restore the upstream default ("always"), which
288
+ // demands comma-combined declarations.
289
+ "one-var": "off",
285
290
  // Restriction — core eslint (cherry-picked from the 90 rules in `restriction`)
286
291
  // Always use braces — prevents the dangling-else bug and ambiguous single-line bodies.
287
292
  curly: "error",
@@ -389,6 +394,10 @@ const config = defineConfig({
389
394
  // Catches typos like `class=` or `tabindex=` in JSX.
390
395
  "react/no-unknown-property": "error",
391
396
  // Restriction — import graph
397
+ // Duplicate named exports and re-exports of names that don't exist — invalid
398
+ // module shapes that only surface at import time. Nursery-classified in
399
+ // oxlint, so no bulk-enabled category covers it; enabled here by name.
400
+ "import/export": "error",
392
401
  // Circular imports produce `undefined` exports at runtime — a real-world crash source.
393
402
  "import/no-cycle": "error",
394
403
  // Restriction — unicorn (modern JS + anti-escape-hatch)
@@ -396,6 +405,8 @@ const config = defineConfig({
396
405
  "unicorn/no-abusive-eslint-disable": "error",
397
406
  // Direct `document.cookie` access — use a cookie library for encoding/security.
398
407
  "unicorn/no-document-cookie": "error",
408
+ // A bare number in `.flat(2)` hides intent — use a named constant or `Infinity`.
409
+ "unicorn/no-magic-array-flat-depth": "error",
399
410
  // `process.exit()` skips `finally` blocks and async flushes. CLI override above handles CLIs.
400
411
  "unicorn/no-process-exit": "error",
401
412
  // `Math.trunc(x)` over `x | 0` — clearer intent, correct for numbers outside Int32 range.
@@ -544,6 +555,9 @@ const config = defineConfig({
544
555
  "perfectionist/sort-enums": ["error", { partitionByComment: true, sortByValue: "always" }],
545
556
  // `class Foo extends A, B` — alphabetical for stable diffs.
546
557
  "perfectionist/sort-heritage-clauses": "error",
558
+ // Interfaces are banned by consistent-type-definitions, but `.d.ts` and
559
+ // declaration-merging files still carry them — keep those sorted too.
560
+ "perfectionist/sort-interfaces": "error",
547
561
  // JSX prop order is a huge diff-noise source — sort it.
548
562
  "perfectionist/sort-jsx-props": "error",
549
563
  // Type fields sorted alphabetically for scannability.
@@ -598,6 +612,14 @@ const config = defineConfig({
598
612
  "react-hooks/exhaustive-deps": "error",
599
613
  // Hooks only at the top level, only from React functions — never in conditions/loops.
600
614
  "react-hooks/rules-of-hooks": "error",
615
+ // @nkzw — only require-use-effect-arguments from the plugin's three rules.
616
+ // ensure-relay-types is Relay-specific (unused in the fleet) and no-instanceof
617
+ // conflicts with the `err instanceof Error` narrowing our unknown-first
618
+ // catch-handling rules push toward.
619
+ // `useEffect(fn)` with no deps array runs after every render — always an
620
+ // explicit choice, never an omission. exhaustive-deps validates the array's
621
+ // contents but cannot require its presence.
622
+ "@nkzw/require-use-effect-arguments": "error",
601
623
  // Testing
602
624
  // `.only()` in a test file skips every other test — must never land on main.
603
625
  "no-only-tests/no-only-tests": "error",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oxlint-config-awesomeness",
3
- "version": "4.2.0",
3
+ "version": "4.4.0",
4
4
  "description": "Oxlint config with sensible defaults.",
5
5
  "keywords": [
6
6
  "autofix",
@@ -45,6 +45,7 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@changesets/cli": "^3.0.0",
48
+ "@nkzw/eslint-plugin": "^2.0.0",
48
49
  "@types/node": "^26.2.0",
49
50
  "eslint-plugin-no-only-tests": "^3.4.0",
50
51
  "eslint-plugin-perfectionist": "^5.10.1",
@@ -60,6 +61,7 @@
60
61
  "vitest": "^4.1.10"
61
62
  },
62
63
  "peerDependencies": {
64
+ "@nkzw/eslint-plugin": "^2.0.0",
63
65
  "eslint-plugin-no-only-tests": "^3.4.0",
64
66
  "eslint-plugin-perfectionist": "^5.10.1",
65
67
  "eslint-plugin-unused-imports": "~4.4.1",