oxlint-plugin-arch 0.12.4 → 0.12.6

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,62 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.12.6
4
+
5
+ ### Added
6
+
7
+ - `arch/effect-layers`: one layer per line in `Layer.mergeAll(...)` and in the layer arrays of `Effect.provide`, `Layer.provide` and `Layer.provideMerge`, from `min` items (default `2`). `merge: { callees, min }` and `provide: { callees, min }` set each side; `indent` sets the fix. The fix changes only whitespace. The `effect` group enables it.
8
+ - `arch/effect-merge-pipe`: a multi-line `Layer.mergeAll(...)` is named before it is piped: no `.pipe(` on it and not the first argument of `pipe(...)`. `merge`, `pipe` and `methods` options. Reports only. The `effect` group enables it.
9
+ - `arch/effect-values-first`: values come before helpers and methods, at file level and inside each top-level function or Effect builder. `builders` and `pinned` options. The `effect` group enables it.
10
+ - `arch/effect-layer-file`: a layer file exports `layer` built with Layer from one Effect named `make`; other layers are local `layer<Role>`. `layer`, `make`, `prefix`, `builders`, `layers`, `services` and `constructors` options. Not in a group; scope it to layer files.
11
+ - `arch/effect-schema-first`: a types file declares Schemas, kept interfaces, `declare module`, then type aliases, with `typeof X.Type` aliases in Schema order and data interfaces made Schemas. `member`, `keep`, `runtime`, `rows` (off by default), `order` (the section order) and `derived` (`first`, `sorted`) options. Not in a group; scope it to types files.
12
+ - `arch/types-duplicate`: reports an interface, object type alias or struct Schema with the same members as an earlier one. `structs` and `min` options.
13
+ - `arch/schemas-local`: `imports: false` reports constructions only; `values: true` keeps a construction inline when it reads a parameter or local.
14
+
15
+ ### Changed
16
+
17
+ - **Breaking:** the `effect` group turns on every rule from `@effect/tsgo`'s `correctness`, `antipattern`, `effectNative` and `style` presets and `@opsydyn/oxlint-effect`'s `recommended` rules, and turns off the oxlint-effect rules that contradict its own or flag common Effect idioms, plus test and entry relaxations; new `entries` option (globs) for entry files that provide their own layers. It now needs both packages (optional peer dependencies) and fails with the install command when one is missing; lint runs through `effect-tsgo`.
18
+
19
+ ## 0.12.5
20
+
21
+ ### Added
22
+
23
+ - `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.
24
+ - `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.
25
+ - `arch/layout-ternary`, `arch/layout-call-arguments`: `indent` accepts `'tab'` like the other layout rules.
26
+ - `arch/code-branch-once`: `min` option (default `2`), the smallest number of ternaries on one subject that is reported.
27
+ - `arch/tests-concurrent-db`: `fixtures` (default `['db']`) and `callees` (default `['test.concurrent']`) options name the shared fixtures and the concurrent test callees.
28
+ - `arch/tests-modifiers`: `modifiers` option (default `['only', 'skip', 'todo']`) replaces the reported modifiers.
29
+ - `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.
30
+ - `arch/boundaries-rpc-database`: `methods` option replaces the reported query-builder methods (default `selectFrom`, `insertInto`, `updateTable`, `deleteFrom`, `mergeInto`, `executeQuery`).
31
+ - `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.
32
+ - `arch/comments-code`: `why` also takes a string that replaces the `Why:` prefix, such as `'NOTE:'` or `'NOTE: '`; continuation lines follow it.
33
+ - `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.
34
+ - `arch/files-externals`: `files` option (default `'^(?:vite|next)\.config\.[cm]?[jt]s$'`) names the config files that are checked.
35
+ - `arch/react-props`: `suffix` option (default `'Props'`) for the props interface name.
36
+ - `arch/boundaries-imports`: `surfaces` option (default `['service', 'client', 'server', 'rsc', 'utils']`) names the public surface file suffixes.
37
+ - `arch/boundaries-tanstack`: `renderers` option (default `['renderServerComponent', 'renderToReadableStream']`) names the RSC renderers that need a server boundary.
38
+ - `arch/boundaries-next`: `serverHooks` option (default `['useId', 'use']`) names the hooks server and RSC modules may use.
39
+ - `arch/backend-registry`: `file` option (default `'{folder}.service.ts'`) names the service file each domain folder needs.
40
+
41
+ - `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`.
42
+ - `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.
43
+
44
+ ### Changed
45
+
46
+ - `arch/layout-call-arguments`: `join` counts a kept trailing comma toward `max`.
47
+
48
+ ### Fixed
49
+
50
+ - `arch/layout-call-arguments`: with `min: 2` and `split` on, `join` no longer joins a two-argument call that `split` breaks again.
51
+ - `arch/tests-concurrent-db`: a fixture destructured with a string key, like `({ 'db': database })`, is reported.
52
+ - `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`.
53
+ - `arch/code-traced`: an untraced value exported by name, like `export { send }` or `export { send as deliver }`, is reported.
54
+ - `arch/naming-declarations`: declarations inside a loop body, like `for (;;) { const wrong = 1 }`, are checked; only the loop header stays exempt.
55
+ - `arch/naming-exports`: an aliased export is checked by its exported name, so `export { invoiceX as bad }` is reported.
56
+ - `arch/tests-concurrent-db`: a computed key, like `({ [db]: value })`, is no longer reported.
57
+ - `arch/code-inline`: a const is no longer reported when a call, assignment or other side effect sits between it and its one read.
58
+ - `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.
59
+
3
60
  ## 0.12.4
4
61
 
5
62
  ### Added
package/README.md CHANGED
@@ -57,7 +57,7 @@ On by default: [`layout`](docs/groups/layout.md), [`limits`](docs/groups/limits.
57
57
 
58
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
- 75 rules, IDs `arch/<rule>`. 🔧 = autofix.
60
+ 81 rules, IDs `arch/<rule>`. 🔧 = autofix.
61
61
 
62
62
  | Family | Covers | Rules |
63
63
  | --- | --- | --- |
@@ -72,7 +72,7 @@ Opt-in: [`react`](docs/groups/react.md), [`tanstack`](docs/groups/tanstack.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) |
74
74
  | `tests` | Test structure | [`tests-assertions`](docs/rules/tests-assertions.md), [`tests-concurrent-db`](docs/rules/tests-concurrent-db.md), [`tests-modifiers`](docs/rules/tests-modifiers.md), [`tests-titles`](docs/rules/tests-titles.md) |
75
- | `types` | Type placement and shape | [`types-declarations`](docs/rules/types-declarations.md), [`types-imported-alias`](docs/rules/types-imported-alias.md), [`types-inline`](docs/rules/types-inline.md), [`types-local-alias`](docs/rules/types-local-alias.md), [`types-namespace-import`](docs/rules/types-namespace-import.md), [`types-service`](docs/rules/types-service.md), [`types-unknown`](docs/rules/types-unknown.md) |
75
+ | `types` | Type placement and shape | [`types-declarations`](docs/rules/types-declarations.md), [`types-duplicate`](docs/rules/types-duplicate.md), [`types-imported-alias`](docs/rules/types-imported-alias.md), [`types-inline`](docs/rules/types-inline.md), [`types-local-alias`](docs/rules/types-local-alias.md), [`types-namespace-import`](docs/rules/types-namespace-import.md), [`types-service`](docs/rules/types-service.md), [`types-unknown`](docs/rules/types-unknown.md) |
76
76
  <!-- generated:end -->
77
77
 
78
78
  Also bundled: [Dillon Mulroy's anti-slop rules](docs/vendor.md) as `oxlint-plugin-arch/dillon-anti-slop`.