oxlint-plugin-arch 0.12.0 → 0.12.1
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 +26 -0
- package/dist/index.js +6 -2
- package/dist/preset/preset-detect.d.ts +1 -2
- package/dist/preset/preset-stylesheet.d.ts +1 -0
- package/dist/preset/preset-units.d.ts +2 -0
- package/dist/preset/preset.constants.d.ts +2 -0
- package/dist/preset/preset.js +566 -338
- package/dist/preset/preset.utils.d.ts +3 -0
- package/dist/types/preset.types.d.ts +7 -1
- package/dist/vendor/dillon-anti-slop/index.js +32 -3
- package/package.json +3 -3
- package/src/vendor/dillon-anti-slop/UPSTREAM.md +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.12.1
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Preset: tests live in a `tests/` (or `test/`) folder. A `*.test.*` or `*.spec.*` file inside a unit's source is reported by `arch/files-restricted`.
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Preset detection reads `pnpm-workspace.yaml` (block or flow lists), workspace globs with `*` anywhere, `**`, `{a,b}` and `!exclude`, and peer dependencies (a UI package with React as a peer is `ui`). Packages and service domains named like output folders (`build`, `public`) are no longer skipped.
|
|
12
|
+
- Preset detection keeps a root app's or backend's recipe next to its workspace packages (when the root has its own source folder), gives a single root package its recipe (`library` included), and keeps the root unit next to a detected `scripts/` CLI. A folder with its own `package.json` is a unit with its own kind, also when nested in another workspace or listed through a `*` key, instead of inheriting the root app's kind.
|
|
13
|
+
- Preset: a unit without `src/` uses its own folder as source (a workspace Next app with `app/` at the package root).
|
|
14
|
+
- Preset detection honors a configured `source`, `backend.registry` file or `false`, expands `*` keys (with exact keys beside them, which also inherit the wildcard's `source`) before adding conventions, and understands import maps such as `"#/*": "./src/*.ts"`, `"#/*.ts": "./src/*.ts"`, exact and conditional entries.
|
|
15
|
+
- Preset detection: a service may import its own domain's operations; other domains stay banned through one `!(domain)` pattern per domain, and a ban you configure yourself is never lifted. A web app's or package's own aliases that overlap the backend's (`#/*`, `#/lib/*`) are no longer banned.
|
|
16
|
+
- Preset detection skips broken symlinks, follows symlinked folders, and drops conventions inside a `false` folder or for a group a parent sets to `false` (an exact key beats a `*` key at the same depth, and an exact key that revives a unit under a `false` wildcard keeps its conventions), instead of throwing.
|
|
17
|
+
- Preset: folder keys accept dots (`packages/my.lib`, `.agents`), and `apps/web/` or `./apps` match the detected `apps/web` and `apps`.
|
|
18
|
+
- Preset: nested group options merge with the inherited ones (`tests.mocking: { allow: [] }` keeps the parent's `preset` and `deny`, also when the parent used the `'strict'` shorthand).
|
|
19
|
+
- Preset: the registry file is exempt from the domain layout and its file and folder name checks; test files skip the domain, operation and frontend runtime file name checks (the `tests/` check below reports them once); operation files in `actions/` and `queries/` keep the single-export check; `layout.strict` accepts `.rsc.tsx`.
|
|
20
|
+
- Preset: Tailwind stylesheet detection ignores comments, strings and plugins such as `tailwindcss-animate`, accepts `@import url("tailwindcss")` with or without quotes, and follows symlinked folders.
|
|
21
|
+
- Preset: `dist`, `build`, `coverage` and `.output` are ignored at the project root and at each unit's root, not at any depth, so a `services/build/` domain is linted.
|
|
22
|
+
- `arch/boundaries-deny` import globs accept `!(a|b)`: one path segment that is none of the names.
|
|
23
|
+
- Preset: `layout.strict` checks domain file names at any depth under `services/<domain>/`, so a nested or misnamed file (`order/queries/order-query-list.ts`) is reported for its name, not only its folder. `layout.operations: 'folders'` keeps its own `actions/` and `queries/` names.
|
|
24
|
+
- Preset detection: a `next` or `vinext` dependency wins over a leftover `@tanstack/react-start` one.
|
|
25
|
+
- Preset detection: a package with `services/<domain>/<domain>.service.ts` gets the `backend` recipe without a backend framework dependency.
|
|
26
|
+
- Preset: `services/**/*.rsc.{ts,tsx}` files and frontend operation files (`*-action.*.client.ts` and the other runtime suffixes) keep the export prefix check next to their name pattern or template. Since 0.12.0 the later override replaced it; 0.11 ran both.
|
|
27
|
+
- `dillon-anti-slop/no-shape-in-symbol-names` reports only names you declare: not another API's property (`schema.shape`, `record.shape = 1`), a renamed destructured property or import, a qualified type read, a JSX member or attribute, or a renamed re-export from another module. A shorthand property reports once.
|
|
28
|
+
|
|
3
29
|
## 0.12.0
|
|
4
30
|
|
|
5
31
|
### Breaking: rebuilt package
|
package/dist/index.js
CHANGED
|
@@ -32,8 +32,12 @@ function optionsPatternsTest(patterns, value) {
|
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
function optionsGlob(pattern) {
|
|
35
|
-
const
|
|
36
|
-
|
|
35
|
+
const negated = [];
|
|
36
|
+
const source = pattern.replaceAll(/!\(([^()]*)\)/g, (_, options) => {
|
|
37
|
+
negated.push(options.split("|").map((option) => option.replaceAll(/[.+^$()|[\]\\*?{}]/g, "\\$&")).join("|"));
|
|
38
|
+
return `\x02${negated.length - 1}\x03`;
|
|
39
|
+
}).replaceAll(/[.+^$()|[\]\\]/g, "\\$&").replaceAll("?", "[^/]").replaceAll("**/", "\x00").replaceAll("**", "\x01").replaceAll("*", "[^/]*").replaceAll("\x00", "(?:.*/)?").replaceAll("\x01", ".*").replaceAll(/\{([^}]*)\}/g, (_, options) => `(?:${options.split(",").join("|")})`);
|
|
40
|
+
return new RegExp(`^${negated.reduce((text, names, index) => text.replace(`\x02${index}\x03`, `(?!(?:${names})(?:/|$))[^/]*`), source)}$`);
|
|
37
41
|
}
|
|
38
42
|
function optionsPatternLabel(pattern) {
|
|
39
43
|
return pattern === undefined ? "" : [pattern].flat().filter((source) => source !== "").join(" | ");
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type * as PresetTypes from '../types/preset.types.ts';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function presetRegistryFile(root: string, source: string, configured: PresetTypes.PresetBackendOptions['registry']): string | undefined;
|
|
3
3
|
export declare function presetDetect(root: string, folders: PresetTypes.PresetFolders): PresetTypes.PresetFolders;
|
|
4
|
-
export declare function presetStylesheet(root: string, directory: string): string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function presetStylesheet(root: string, directory: string): string | undefined;
|
|
@@ -41,6 +41,8 @@ export declare const presetExportPrefix: {
|
|
|
41
41
|
};
|
|
42
42
|
export declare const presetGeneratedFiles: string[];
|
|
43
43
|
export declare const presetBuiltinFileRoles: string[];
|
|
44
|
+
export declare const presetShorthandOptions: readonly [readonly ['tests', 'mocking', 'preset'], readonly ['backend', 'registry', 'file']];
|
|
45
|
+
export declare const presetOutputFolders: string[];
|
|
44
46
|
export declare const presetLiteralSegment: RegExp;
|
|
45
47
|
export declare const presetIllustrationPalette: string[];
|
|
46
48
|
export declare const presetGroupOrder: PresetTypes.PresetGroupName[];
|