oxlint-plugin-arch 0.12.3 → 0.12.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,68 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.12.5
4
+
5
+ ### Added
6
+
7
+ - `arch/layout-object`: `join` option (`{ max, keep? }`). A split object with fewer than `min` properties goes on one line when it fits in `max` columns, every property is one line and none holds an object, array or function, and it has no comments. `keep` lists callees (such as `object` for `z.object`) whose object arguments stay split. `join` follows `scope`. Unset, the rule is unchanged.
8
+ - `arch/layout-jsx-attributes`: `join` option (`{ max }`). A split tag with fewer than `min` attributes goes on one line when it fits in `max` columns, every attribute is one line, its name and type arguments are one line and it has no comments. Unset, the rule is unchanged.
9
+ - `arch/layout-ternary`, `arch/layout-call-arguments`: `indent` accepts `'tab'` like the other layout rules.
10
+ - `arch/code-branch-once`: `min` option (default `2`), the smallest number of ternaries on one subject that is reported.
11
+ - `arch/tests-concurrent-db`: `fixtures` (default `['db']`) and `callees` (default `['test.concurrent']`) options name the shared fixtures and the concurrent test callees.
12
+ - `arch/tests-modifiers`: `modifiers` option (default `['only', 'skip', 'todo']`) replaces the reported modifiers.
13
+ - `arch/tests-titles`: `modifiers` option (default `['only', 'skip', 'concurrent', 'sequential', 'todo', 'each', 'for']`) replaces the modifiers whose titles are checked; add `'fails'` to check `test.fails` titles.
14
+ - `arch/boundaries-rpc-database`: `methods` option replaces the reported query-builder methods (default `selectFrom`, `insertInto`, `updateTable`, `deleteFrom`, `mergeInto`, `executeQuery`).
15
+ - `arch/types-service`: `suffix` (default `'Service'`) and `factory` (default `'make'`) options for the allowed `XService = ReturnType<typeof makeXService>` alias; the message names the configured suffix.
16
+ - `arch/comments-code`: `why` also takes a string that replaces the `Why:` prefix, such as `'NOTE:'` or `'NOTE: '`; continuation lines follow it.
17
+ - `arch/files-domain-constants`: `pattern` option (default `'^[A-Z][A-Z0-9_]+$'`) names the constants to report. `folders` (default `['services']`), `roles` (default `['action', 'query']`) and `file` (default `'{domain}.constants.ts'`) set the file the message points to.
18
+ - `arch/files-externals`: `files` option (default `'^(?:vite|next)\.config\.[cm]?[jt]s$'`) names the config files that are checked.
19
+ - `arch/react-props`: `suffix` option (default `'Props'`) for the props interface name.
20
+ - `arch/boundaries-imports`: `surfaces` option (default `['service', 'client', 'server', 'rsc', 'utils']`) names the public surface file suffixes.
21
+ - `arch/boundaries-tanstack`: `renderers` option (default `['renderServerComponent', 'renderToReadableStream']`) names the RSC renderers that need a server boundary.
22
+ - `arch/boundaries-next`: `serverHooks` option (default `['useId', 'use']`) names the hooks server and RSC modules may use.
23
+ - `arch/backend-registry`: `file` option (default `'{folder}.service.ts'`) names the service file each domain folder needs.
24
+
25
+ - `arch/layout-call-arguments`: `join.items` option (default `2`) sets how many one-line items `join` puts on one line; while `split` is on it stays below `min`.
26
+ - `arch/files-components-only`: `filename: 'each'` checks that every component starts with the file name; the default `true` still lets one exact match or a shared prefix cover the file.
27
+
28
+ ### Changed
29
+
30
+ - `arch/layout-call-arguments`: `join` counts a kept trailing comma toward `max`.
31
+
32
+ ### Fixed
33
+
34
+ - `arch/layout-call-arguments`: with `min: 2` and `split` on, `join` no longer joins a two-argument call that `split` breaks again.
35
+ - `arch/tests-concurrent-db`: a fixture destructured with a string key, like `({ 'db': database })`, is reported.
36
+ - `arch/code-paired-call`: an import alias counts only where it resolves to the import, so a local `r` shadowing `import { required as r }`, or a method `form.r()`, no longer satisfies `required`.
37
+ - `arch/code-traced`: an untraced value exported by name, like `export { send }` or `export { send as deliver }`, is reported.
38
+ - `arch/naming-declarations`: declarations inside a loop body, like `for (;;) { const wrong = 1 }`, are checked; only the loop header stays exempt.
39
+ - `arch/naming-exports`: an aliased export is checked by its exported name, so `export { invoiceX as bad }` is reported.
40
+ - `arch/tests-concurrent-db`: a computed key, like `({ [db]: value })`, is no longer reported.
41
+ - `arch/code-inline`: a const is no longer reported when a call, assignment or other side effect sits between it and its one read.
42
+ - `arch/schemas-local`: the import check follows references to the imported binding, so a property key or a shadowing parameter named `z` no longer marks a `z.config` import as a runtime import.
43
+
44
+ ## 0.12.4
45
+
46
+ ### Added
47
+
48
+ - `effect` preset group and `recipes.effect`: layout and code rules for Effect code, opt-in. It turns off `arch/code-trivial-functions`, which reports Effect functions written as one pipe. Options: `width` (line width for the layout rules, default `160`), `exports` (files whose exports must be traced) and `skip` (service names left untraced).
49
+ - `arch/layout-call-arguments`: `hug`, `join` and `split` options. `hug` keeps a multi-line call either hugging its last callback, object or array or one argument per line; `join` puts a short split call or parameter list on one line; `split: false` turns the `min` check off. Defaults are unchanged.
50
+ - `arch/layout-ternary`: `branch` option reports a ternary branch longer than `max` lines; `fit: false` turns the join and split checks off. Defaults are unchanged.
51
+ - `arch/layout-items`: a multi-line object or array puts each item on its own line.
52
+ - `arch/layout-call-depth`: calls nested more than `max` deep on one line.
53
+ - `arch/layout-arrow-body`: an arrow body starts on the arrow's line when it fits.
54
+ - `arch/layout-pipe`: no `).pipe(` after a multi-line call, and no multi-line call inside a pipe step.
55
+ - `arch/code-inline`: a one-line const read once is inlined; a top-level const that only wraps one call or arrow is inlined at each use.
56
+ - `arch/code-branch-once`: a member compared to strings in several ternaries in one file.
57
+ - `arch/code-function-nesting`: functions nested more than `max` deep.
58
+ - `arch/code-yield-argument`: a `yield*` passed straight into a call or member access.
59
+ - `arch/code-justified-call`: listed calls need a `// SAFETY: <why>` comment on the line above.
60
+ - `arch/code-traced`: exported functions and service methods built with an untraced helper (`Effect.fnUntraced` by default).
61
+
62
+ ### Fixed
63
+
64
+ - Preset detection: a `migrations/` folder under `tests/` or `test/` keeps test file names. Migration tests can mirror their source (`tests/database/migrations/003-products.test.ts`) instead of getting the numbered migration name rule.
65
+
3
66
  ## 0.12.3
4
67
 
5
68
  ### Fixed
package/README.md CHANGED
@@ -55,19 +55,19 @@ bunx oxlint
55
55
  <!-- generated:start -->
56
56
  On by default: [`layout`](docs/groups/layout.md), [`limits`](docs/groups/limits.md), [`style`](docs/groups/style.md), [`basics`](docs/groups/basics.md), [`naming`](docs/groups/naming.md), [`comments`](docs/groups/comments.md), [`types`](docs/groups/types.md), [`imports`](docs/groups/imports.md), [`tests`](docs/groups/tests.md), [`deny`](docs/groups/deny.md), [`externals`](docs/groups/externals.md).
57
57
 
58
- Opt-in: [`react`](docs/groups/react.md), [`tanstack`](docs/groups/tanstack.md), [`next`](docs/groups/next.md), [`expo`](docs/groups/expo.md), [`tailwind`](docs/groups/tailwind.md), [`shadcn`](docs/groups/shadcn.md), [`kit`](docs/groups/kit.md), [`backend`](docs/groups/backend.md), [`orpc`](docs/groups/orpc.md), [`schemas`](docs/groups/schemas.md), [`forms`](docs/groups/forms.md), [`sql`](docs/groups/sql.md), [`console`](docs/groups/console.md).
58
+ Opt-in: [`react`](docs/groups/react.md), [`tanstack`](docs/groups/tanstack.md), [`next`](docs/groups/next.md), [`expo`](docs/groups/expo.md), [`tailwind`](docs/groups/tailwind.md), [`shadcn`](docs/groups/shadcn.md), [`kit`](docs/groups/kit.md), [`backend`](docs/groups/backend.md), [`orpc`](docs/groups/orpc.md), [`schemas`](docs/groups/schemas.md), [`forms`](docs/groups/forms.md), [`sql`](docs/groups/sql.md), [`effect`](docs/groups/effect.md), [`console`](docs/groups/console.md).
59
59
 
60
- 65 rules, IDs `arch/<rule>`. 🔧 = autofix.
60
+ 75 rules, IDs `arch/<rule>`. 🔧 = autofix.
61
61
 
62
62
  | Family | Covers | Rules |
63
63
  | --- | --- | --- |
64
64
  | `backend` | Service and RPC structure | [`backend-orpc-output`](docs/rules/backend-orpc-output.md), [`backend-registry`](docs/rules/backend-registry.md), [`backend-service-functions`](docs/rules/backend-service-functions.md), [`backend-sql-like`](docs/rules/backend-sql-like.md) |
65
65
  | `boundaries` | Import and runtime boundaries | [`boundaries-deny`](docs/rules/boundaries-deny.md), [`boundaries-imports`](docs/rules/boundaries-imports.md), [`boundaries-next`](docs/rules/boundaries-next.md), [`boundaries-rpc-database`](docs/rules/boundaries-rpc-database.md), [`boundaries-tanstack`](docs/rules/boundaries-tanstack.md), [`boundaries-token-owner`](docs/rules/boundaries-token-owner.md) |
66
- | `code` | Code shapes to avoid | [`code-constructor`](docs/rules/code-constructor.md), [`code-double-negation`](docs/rules/code-double-negation.md), [`code-literal-in`](docs/rules/code-literal-in.md), [`code-mutable-state`](docs/rules/code-mutable-state.md), [`code-object-params`](docs/rules/code-object-params.md), [`code-paired-call`](docs/rules/code-paired-call.md), [`code-promise-mutation`](docs/rules/code-promise-mutation.md), [`code-switch`](docs/rules/code-switch.md), [`code-trivial-functions`](docs/rules/code-trivial-functions.md) |
66
+ | `code` | Code shapes to avoid | [`code-branch-once`](docs/rules/code-branch-once.md), [`code-constructor`](docs/rules/code-constructor.md), [`code-double-negation`](docs/rules/code-double-negation.md), [`code-function-nesting`](docs/rules/code-function-nesting.md), [`code-inline`](docs/rules/code-inline.md), [`code-justified-call`](docs/rules/code-justified-call.md), [`code-literal-in`](docs/rules/code-literal-in.md), [`code-mutable-state`](docs/rules/code-mutable-state.md), [`code-object-params`](docs/rules/code-object-params.md), [`code-paired-call`](docs/rules/code-paired-call.md), [`code-promise-mutation`](docs/rules/code-promise-mutation.md), [`code-switch`](docs/rules/code-switch.md), [`code-traced`](docs/rules/code-traced.md), [`code-trivial-functions`](docs/rules/code-trivial-functions.md), [`code-yield-argument`](docs/rules/code-yield-argument.md) |
67
67
  | `comments` | Comments and directives | [`comments-code`](docs/rules/comments-code.md) 🔧, [`comments-directives`](docs/rules/comments-directives.md) |
68
68
  | `copy` | User-facing text | [`copy-dashes`](docs/rules/copy-dashes.md) |
69
69
  | `files` | What a file may contain or export | [`files-components-only`](docs/rules/files-components-only.md), [`files-constants-only`](docs/rules/files-constants-only.md), [`files-domain-constants`](docs/rules/files-domain-constants.md), [`files-exports`](docs/rules/files-exports.md), [`files-externals`](docs/rules/files-externals.md), [`files-factory-keys`](docs/rules/files-factory-keys.md), [`files-helpers`](docs/rules/files-helpers.md), [`files-no-functions`](docs/rules/files-no-functions.md), [`files-restricted`](docs/rules/files-restricted.md), [`files-route`](docs/rules/files-route.md), [`files-types-only`](docs/rules/files-types-only.md) |
70
- | `layout` | Layout a formatter leaves alone | [`layout-call-arguments`](docs/rules/layout-call-arguments.md) 🔧, [`layout-call-array`](docs/rules/layout-call-array.md) 🔧, [`layout-chain`](docs/rules/layout-chain.md) 🔧, [`layout-jsx-attributes`](docs/rules/layout-jsx-attributes.md) 🔧, [`layout-key-value`](docs/rules/layout-key-value.md) 🔧, [`layout-object`](docs/rules/layout-object.md) 🔧, [`layout-padding`](docs/rules/layout-padding.md) 🔧, [`layout-ternary`](docs/rules/layout-ternary.md) 🔧 |
70
+ | `layout` | Layout a formatter leaves alone | [`layout-arrow-body`](docs/rules/layout-arrow-body.md) 🔧, [`layout-call-arguments`](docs/rules/layout-call-arguments.md) 🔧, [`layout-call-array`](docs/rules/layout-call-array.md) 🔧, [`layout-call-depth`](docs/rules/layout-call-depth.md), [`layout-chain`](docs/rules/layout-chain.md) 🔧, [`layout-items`](docs/rules/layout-items.md) 🔧, [`layout-jsx-attributes`](docs/rules/layout-jsx-attributes.md) 🔧, [`layout-key-value`](docs/rules/layout-key-value.md) 🔧, [`layout-object`](docs/rules/layout-object.md) 🔧, [`layout-padding`](docs/rules/layout-padding.md) 🔧, [`layout-pipe`](docs/rules/layout-pipe.md), [`layout-ternary`](docs/rules/layout-ternary.md) 🔧 |
71
71
  | `naming` | File, folder and export names | [`naming-declarations`](docs/rules/naming-declarations.md), [`naming-exports`](docs/rules/naming-exports.md), [`naming-file`](docs/rules/naming-file.md), [`naming-folder`](docs/rules/naming-folder.md), [`naming-types`](docs/rules/naming-types.md) |
72
72
  | `react` | Components, effects, class names | [`react-dynamic-classes`](docs/rules/react-dynamic-classes.md), [`react-empty-effect`](docs/rules/react-empty-effect.md), [`react-memo`](docs/rules/react-memo.md), [`react-props`](docs/rules/react-props.md) |
73
73
  | `schemas` | Schema placement | [`schemas-inline`](docs/rules/schemas-inline.md), [`schemas-local`](docs/rules/schemas-local.md), [`schemas-rederive`](docs/rules/schemas-rederive.md), [`schemas-single-use`](docs/rules/schemas-single-use.md) |