@starci/eslint-canon-be 3.5.0 → 3.6.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 +21 -0
- package/README.md +13 -2
- package/dist/ambient-id.d.ts +9 -0
- package/{ambient-id.mjs → dist/ambient-id.js} +43 -39
- package/dist/app-composition.d.ts +21 -0
- package/{app-composition.mjs → dist/app-composition.js} +396 -300
- package/dist/async-discipline.d.ts +9 -0
- package/dist/async-discipline.js +77 -0
- package/dist/authorization.d.ts +12 -0
- package/{authorization.mjs → dist/authorization.js} +53 -59
- package/dist/boundary-schema.d.ts +15 -0
- package/{boundary-schema.mjs → dist/boundary-schema.js} +120 -105
- package/dist/builders.d.ts +21 -0
- package/{builders.mjs → dist/builders.js} +162 -146
- package/dist/cli.d.ts +15 -0
- package/{cli.mjs → dist/cli.js} +97 -82
- package/dist/comments.d.ts +52 -0
- package/dist/comments.js +412 -0
- package/dist/config-owner.d.ts +24 -0
- package/{config-owner.mjs → dist/config-owner.js} +256 -219
- package/dist/connections.d.ts +12 -0
- package/{connections.mjs → dist/connections.js} +138 -140
- package/dist/cookies.d.ts +9 -0
- package/{cookies.mjs → dist/cookies.js} +58 -58
- package/dist/cqrs.d.ts +27 -0
- package/{cqrs.mjs → dist/cqrs.js} +341 -282
- package/dist/data-access.d.ts +50 -0
- package/{data-access.mjs → dist/data-access.js} +238 -243
- package/dist/default-deny.d.ts +15 -0
- package/{default-deny.mjs → dist/default-deny.js} +103 -88
- package/dist/e2e-flow.d.ts +25 -0
- package/{e2e-flow.mjs → dist/e2e-flow.js} +113 -112
- package/dist/edge-hardening.d.ts +10 -0
- package/dist/edge-hardening.js +173 -0
- package/dist/error-handling.d.ts +21 -0
- package/{error-handling.mjs → dist/error-handling.js} +289 -239
- package/dist/event-bus.d.ts +14 -0
- package/{event-bus.mjs → dist/event-bus.js} +146 -129
- package/dist/feature-thin.d.ts +12 -0
- package/{feature-thin.mjs → dist/feature-thin.js} +208 -191
- package/dist/function-budget.d.ts +7 -0
- package/{function-budget.mjs → dist/function-budget.js} +24 -27
- package/dist/health-ready.d.ts +10 -0
- package/dist/health-ready.js +703 -0
- package/dist/idempotency.d.ts +10 -0
- package/{idempotency.mjs → dist/idempotency.js} +296 -226
- package/dist/index.d.ts +54 -0
- package/{index.mjs → dist/index.js} +91 -109
- package/dist/infra-owner.d.ts +18 -0
- package/{infra-owner.mjs → dist/infra-owner.js} +58 -51
- package/dist/injection.d.ts +30 -0
- package/{injection.mjs → dist/injection.js} +397 -344
- package/dist/input-bounds.d.ts +15 -0
- package/{input-bounds.mjs → dist/input-bounds.js} +143 -132
- package/dist/jobs.d.ts +17 -0
- package/{jobs.mjs → dist/jobs.js} +116 -99
- package/dist/jwt-alg.d.ts +6 -0
- package/dist/jwt-alg.js +49 -0
- package/dist/lib/app-roles.d.ts +25 -0
- package/{lib/app-roles.mjs → dist/lib/app-roles.js} +15 -17
- package/dist/lib/ast.d.ts +40 -0
- package/dist/lib/ast.js +100 -0
- package/dist/lib/client-idempotency.d.ts +3 -0
- package/{lib/client-idempotency.mjs → dist/lib/client-idempotency.js} +316 -268
- package/dist/lib/config.d.ts +36 -0
- package/{lib/config.mjs → dist/lib/config.js} +24 -27
- package/dist/lib/db-writes.d.ts +29 -0
- package/{lib/db-writes.mjs → dist/lib/db-writes.js} +27 -27
- package/dist/lib/declared.d.ts +77 -0
- package/{lib/declared.mjs → dist/lib/declared.js} +83 -78
- package/dist/lib/doors.d.ts +50 -0
- package/{lib/doors.mjs → dist/lib/doors.js} +45 -50
- package/dist/lib/edition.d.ts +25 -0
- package/{lib/edition.mjs → dist/lib/edition.js} +15 -20
- package/dist/lib/entity-writes.d.ts +7 -0
- package/{lib/entity-writes.mjs → dist/lib/entity-writes.js} +31 -22
- package/dist/lib/hfs-view.d.ts +127 -0
- package/dist/lib/hfs-view.js +1 -0
- package/dist/lib/hfs.d.ts +34 -0
- package/{lib/hfs.mjs → dist/lib/hfs.js} +31 -29
- package/dist/lib/import-source.d.ts +63 -0
- package/dist/lib/import-source.js +134 -0
- package/dist/lib/path.d.ts +8 -0
- package/{lib/path.mjs → dist/lib/path.js} +4 -7
- package/dist/lib/persistence.d.ts +115 -0
- package/{lib/persistence.mjs → dist/lib/persistence.js} +55 -66
- package/dist/lib/ports.d.ts +70 -0
- package/{lib/ports.mjs → dist/lib/ports.js} +62 -66
- package/dist/lib/rule.d.ts +31 -0
- package/dist/lib/rule.js +2 -0
- package/dist/lib/runtime-root.d.ts +4 -0
- package/dist/lib/runtime-root.js +10 -0
- package/dist/lib/schema-values.d.ts +13 -0
- package/{lib/schema-values.mjs → dist/lib/schema-values.js} +67 -59
- package/dist/lib/specifier.d.ts +12 -0
- package/dist/lib/specifier.js +29 -0
- package/dist/lib/subject-values.d.ts +4 -0
- package/dist/lib/subject-values.js +61 -0
- package/dist/lib/transactions.d.ts +18 -0
- package/{lib/transactions.mjs → dist/lib/transactions.js} +17 -15
- package/dist/lib/transport-slots.d.ts +17 -0
- package/{lib/transport-slots.mjs → dist/lib/transport-slots.js} +2 -4
- package/dist/lib/types.d.ts +96 -0
- package/dist/lib/types.js +150 -0
- package/dist/lib/unit-spec.d.ts +48 -0
- package/{lib/unit-spec.mjs → dist/lib/unit-spec.js} +35 -44
- package/dist/lib/webhook-ack.d.ts +4 -0
- package/{lib/webhook-ack.mjs → dist/lib/webhook-ack.js} +78 -62
- package/dist/lib/webhook-handoff-inbox.d.ts +3 -0
- package/{lib/webhook-handoff-inbox.mjs → dist/lib/webhook-handoff-inbox.js} +195 -167
- package/dist/lib/webhook-handoff-intake.d.ts +4 -0
- package/{lib/webhook-handoff-intake.mjs → dist/lib/webhook-handoff-intake.js} +125 -102
- package/dist/lib/webhook-handoff.d.ts +15 -0
- package/{lib/webhook-handoff.mjs → dist/lib/webhook-handoff.js} +107 -100
- package/dist/lib/webhook-verifiers.d.ts +20 -0
- package/{lib/webhook-verifiers.mjs → dist/lib/webhook-verifiers.js} +108 -104
- package/dist/lib/why.d.ts +9 -0
- package/{lib/why.mjs → dist/lib/why.js} +6 -6
- package/dist/log-safety.d.ts +20 -0
- package/dist/log-safety.js +308 -0
- package/dist/module-layering.d.ts +42 -0
- package/dist/module-layering.js +257 -0
- package/dist/module-shape.d.ts +47 -0
- package/{module-shape.mjs → dist/module-shape.js} +278 -236
- package/dist/naming.d.ts +49 -0
- package/dist/naming.js +246 -0
- package/dist/observability.d.ts +25 -0
- package/dist/observability.js +245 -0
- package/dist/operations.d.ts +23 -0
- package/{operations.mjs → dist/operations.js} +410 -332
- package/dist/project-graph.d.ts +9 -0
- package/{project-graph.mjs → dist/project-graph.js} +8 -13
- package/dist/projections.d.ts +11 -0
- package/{projections.mjs → dist/projections.js} +60 -57
- package/dist/query-safety.d.ts +21 -0
- package/{query-safety.mjs → dist/query-safety.js} +92 -108
- package/dist/realtime.d.ts +15 -0
- package/{realtime.mjs → dist/realtime.js} +108 -106
- package/dist/resilience.d.ts +15 -0
- package/dist/resilience.js +319 -0
- package/dist/schema-authority.d.ts +15 -0
- package/{schema-authority.mjs → dist/schema-authority.js} +256 -220
- package/dist/service-deps.d.ts +17 -0
- package/{service-deps.mjs → dist/service-deps.js} +133 -130
- package/dist/service-isolation.d.ts +8 -0
- package/dist/service-isolation.js +76 -0
- package/dist/size-budget.d.ts +9 -0
- package/{size-budget.mjs → dist/size-budget.js} +27 -27
- package/dist/sonar-parity.d.ts +5 -0
- package/{sonar-parity.mjs → dist/sonar-parity.js} +7 -7
- package/dist/spec-no-skip.d.ts +9 -0
- package/dist/spec-no-skip.js +81 -0
- package/dist/spec-quality.d.ts +10 -0
- package/{spec-quality.mjs → dist/spec-quality.js} +103 -87
- package/dist/suppression.d.ts +26 -0
- package/{suppression.mjs → dist/suppression.js} +30 -45
- package/dist/temporal.d.ts +9 -0
- package/{temporal.mjs → dist/temporal.js} +75 -65
- package/dist/test-world.d.ts +28 -0
- package/{test-world.mjs → dist/test-world.js} +102 -83
- package/dist/testing.d.ts +51 -0
- package/dist/testing.js +368 -0
- package/dist/third-party-owner.d.ts +8 -0
- package/{third-party-owner.mjs → dist/third-party-owner.js} +105 -91
- package/dist/transport.d.ts +24 -0
- package/{transport.mjs → dist/transport.js} +279 -240
- package/dist/type-safety.d.ts +25 -0
- package/dist/type-safety.js +297 -0
- package/dist/unit-spec.d.ts +30 -0
- package/{unit-spec.mjs → dist/unit-spec.js} +473 -399
- package/dist/uploads.d.ts +9 -0
- package/{uploads.mjs → dist/uploads.js} +62 -54
- package/dist/user-copy.d.ts +9 -0
- package/{user-copy.mjs → dist/user-copy.js} +76 -67
- package/dist/webhooks.d.ts +16 -0
- package/{webhooks.mjs → dist/webhooks.js} +243 -231
- package/package.json +23 -8
- package/runtime/knowledge/hfs/canon-pins.yaml +18 -11
- package/runtime/scripts/hfs/repo-identity.mjs +5 -4
- package/async-discipline.mjs +0 -83
- package/comments.mjs +0 -416
- package/edge-hardening.mjs +0 -139
- package/health-ready.mjs +0 -539
- package/jwt-alg.mjs +0 -45
- package/lib/ast.mjs +0 -88
- package/lib/import-source.mjs +0 -104
- package/lib/specifier.mjs +0 -27
- package/lib/subject-values.mjs +0 -55
- package/lib/types.mjs +0 -133
- package/log-safety.mjs +0 -303
- package/module-layering.mjs +0 -270
- package/naming.mjs +0 -251
- package/observability.mjs +0 -241
- package/resilience.mjs +0 -304
- package/service-isolation.mjs +0 -75
- package/spec-no-skip.mjs +0 -85
- package/testing.mjs +0 -384
- package/type-safety.mjs +0 -323
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.6.1 - 2026-10-28
|
|
4
|
+
|
|
5
|
+
- Fixed: the published declarations of `loadHfs` and `starciBeConfig` name the emitted `dist/lib/hfs-view.d.ts`, not the untyped `runtime/scripts/hfs/view.mjs`, so a consumer's typed lint of the managed `be/eslint.config.mjs` no longer reads an error type (`no-unsafe-assignment` at 3:33). The view's shapes live in `src/lib/hfs-view.ts`; the runtime functions are read through `#runtime/*`. Spec: `src/published-declarations.spec.ts`.
|
|
6
|
+
- Changed: the bundled runtime's `repo-identity.mjs` names a repository by its origin remote (hfs 4.9.2).
|
|
7
|
+
- Changed: the bundled canon pins follow release D (Grammar family 0.15.1, hfs 4.9.2, canon-fe 9.4.1, canon-be 3.6.1, starci-harness 1.1.0-alpha.2), so an app installs the released versions without pin drift.
|
|
8
|
+
|
|
9
|
+
## 3.6.0 - 2026-10-28
|
|
10
|
+
|
|
11
|
+
- Changed: the package is TypeScript built to JavaScript. Source and specs live in `src/*.ts` (strict, no `any`, no
|
|
12
|
+
suppressions), `npm run build` emits `dist/` with declarations, and `exports`/`main`/`files` point at `dist/`. The
|
|
13
|
+
package specifier and every export (`starciBeConfig`, `loadHfs`, the plugin, `rules`, `recommended`, `ruleOwners`,
|
|
14
|
+
`lawOwners`, `ruleDeclarations`, `linterOptions`) are unchanged. No rule changed behaviour; the spec count is unchanged.
|
|
15
|
+
- Added: `@typescript-eslint/utils` as a dependency for the rule and AST types (already installed with
|
|
16
|
+
`@typescript-eslint/eslint-plugin`).
|
|
17
|
+
- Changed (specs): the front-end canon is loaded through its package entry (`fixtures/sibling-canon.mjs`), not a source
|
|
18
|
+
path; `fixtures/gathered-plugin.mjs` lists law modules by `.mjs` or `.ts`.
|
|
19
|
+
- Changed: the bundled canon pins follow release C (Grammar family 0.15.0, hfs 4.9.1, canon-fe 9.4.0, canon-be 3.6.0,
|
|
20
|
+
jest-preset 2.4.1, stylelint-canon 2.2.1, tsconfig 2.1.0, prettier-config 1.1.0, and `@starci/ai-router` 0.2.1
|
|
21
|
+
pinned), so an app installs the released versions without pin drift.
|
|
22
|
+
- Fixed: the built declarations name `.js`, not the `.ts` sources (`tsc` keeps a relative `.ts` specifier in a `.d.ts`).
|
|
23
|
+
|
|
3
24
|
## 3.5.0 - 2026-10-27
|
|
4
25
|
|
|
5
26
|
- Changed: the bundled runtime copies follow the retirement of `@starci/cli`: the bundled canon pins replace the retired `@starci/cli` with `starci-harness` 1.1.0-alpha.1 (`source: cli/package.json`), the one command line a product installs for `starci app`, and follow the harness packages (Grammar family 0.14.0, hfs 4.9.0, canon-fe 9.3.0, canon-be 3.5.0); the runtime finds an app's `starci` bin in its installed `starci-harness`. No rule changes.
|
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ manifest this package ships in `runtime/` (a byte copy of `knowledge/hfs/slots.y
|
|
|
25
25
|
`scripts/hfs/sync-runtime.mjs`). `starciBeConfig` returns the flat config: typed linting
|
|
26
26
|
(`parserOptions.projectService`) over every `.ts/.mts/.cts/.js/.mjs/.cjs`, ignores `dist/`, `coverage/` and
|
|
27
27
|
`node_modules/` only, `noInlineConfig` with unused-disable reporting, the borrowed typescript-eslint rules, every canon
|
|
28
|
-
rule at `error`, and `settings.starci.hfs` - the slot view each path-scoped rule asks (`lib/hfs.
|
|
28
|
+
rule at `error`, and `settings.starci.hfs` - the slot view each path-scoped rule asks (`src/lib/hfs.ts`). The factory takes
|
|
29
29
|
no globs, ignores or rule overrides, and refuses a recommendation with any rule not at `error`. A rule the standard no
|
|
30
30
|
longer holds is deleted from the plugin; every rule that ships is on.
|
|
31
31
|
|
|
@@ -140,7 +140,18 @@ pointed at.
|
|
|
140
140
|
|
|
141
141
|
## Requirements
|
|
142
142
|
|
|
143
|
-
ESLint 9+ (flat config), Node
|
|
143
|
+
ESLint 9+ (flat config), Node 22.13+ (`engines`).
|
|
144
|
+
|
|
145
|
+
## Source and build
|
|
146
|
+
|
|
147
|
+
The package is TypeScript: `src/*.ts` (one module per law, `src/lib/` for the shared helpers, `src/*.spec.ts` beside the
|
|
148
|
+
source) builds with `tsc -p tsconfig.build.json` into `dist/`, which is what `exports` and `files` publish, with `runtime/`.
|
|
149
|
+
`npm run typecheck` checks source and specs strictly (no `any`); `npm test` runs the specs straight from the TypeScript
|
|
150
|
+
(`node --test`, Node strips the types), so a spec needs no build. The bundled `runtime/` is untyped JavaScript; the parts
|
|
151
|
+
this package imports are declared in `src/types/runtime/`, and the HFS view is imported through `#runtime/*` with its shapes
|
|
152
|
+
in `src/lib/hfs-view.ts`, which is emitted, so the published declarations of `loadHfs` and `starciBeConfig` name no
|
|
153
|
+
untyped runtime file. `fixtures/` is spec data and stays JavaScript with
|
|
154
|
+
`.d.mts` contracts, because the front-end canon and the Grammar lint families import its helpers by path.
|
|
144
155
|
|
|
145
156
|
## HFS rules and their why codes
|
|
146
157
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Recommended, RuleModule } from "./lib/rule.js";
|
|
2
|
+
/** No id is minted outside `platform/ids`. */
|
|
3
|
+
export declare const noAmbientId: RuleModule;
|
|
4
|
+
/** The rule this law contributes to the plugin. */
|
|
5
|
+
export declare const rules: {
|
|
6
|
+
"no-ambient-id": RuleModule;
|
|
7
|
+
};
|
|
8
|
+
/** Starts at error: no baseline exists, and the repositories' fix lanes clear the debt with an Ids codemod. */
|
|
9
|
+
export declare const recommended: Recommended;
|
|
@@ -11,35 +11,36 @@
|
|
|
11
11
|
* exempt: not a spec, and not the test world (slot `be.tests.world`), which asks the same `Ids` port. The generators are found by the module they are imported from, never by a local name,
|
|
12
12
|
* so `import { randomUUID as newId } from "node:crypto"` is the same reference.
|
|
13
13
|
*/
|
|
14
|
-
import { hfsOf } from "./lib/hfs.
|
|
15
|
-
import { isOwnedBy } from "./lib/ports.
|
|
16
|
-
|
|
14
|
+
import { hfsOf } from "./lib/hfs.js";
|
|
15
|
+
import { isOwnedBy } from "./lib/ports.js";
|
|
17
16
|
/** Modules of Node's crypto: `randomUUID` of them mints an id. */
|
|
18
|
-
const CRYPTO_MODULES = new Set(["node:crypto", "crypto"])
|
|
19
|
-
|
|
17
|
+
const CRYPTO_MODULES = new Set(["node:crypto", "crypto"]);
|
|
20
18
|
/** Packages whose named exports mint an id, and which of them (`null`: every export). */
|
|
21
|
-
const ID_PACKAGES = Object.freeze({ uuid: ["v1", "v4", "v6", "v7"], nanoid: null, "nanoid/non-secure": null, ulid: null })
|
|
22
|
-
|
|
19
|
+
const ID_PACKAGES = Object.freeze({ uuid: ["v1", "v4", "v6", "v7"], nanoid: null, "nanoid/non-secure": null, ulid: null });
|
|
20
|
+
/** The name an import specifier imports (an identifier or a string-literal export name). */
|
|
21
|
+
const importedName = (imported) => (imported.type === "Identifier" ? imported.name : imported.value);
|
|
23
22
|
/** The variable a name resolves to from `node`'s scope, or null when it is a global. */
|
|
24
23
|
const variableOf = (context, node, name) => {
|
|
25
|
-
let scope = (context.sourceCode || context.getSourceCode()).getScope(node)
|
|
24
|
+
let scope = (context.sourceCode || context.getSourceCode()).getScope(node);
|
|
26
25
|
while (scope) {
|
|
27
|
-
const found = scope.set.get(name)
|
|
28
|
-
if (found)
|
|
29
|
-
|
|
26
|
+
const found = scope.set.get(name);
|
|
27
|
+
if (found)
|
|
28
|
+
return found;
|
|
29
|
+
scope = scope.upper;
|
|
30
30
|
}
|
|
31
|
-
return null
|
|
32
|
-
}
|
|
33
|
-
|
|
31
|
+
return null;
|
|
32
|
+
};
|
|
34
33
|
/** Whether `node` is the global `crypto` (or `globalThis.crypto`) or an import of Node's crypto module as a whole. */
|
|
35
34
|
const isCryptoObject = (context, node) => {
|
|
36
|
-
if (node.type === "MemberExpression" && !node.computed && node.object.type === "Identifier" && node.object.name === "globalThis" && node.property.type === "Identifier" && node.property.name === "crypto")
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
if (node.type === "MemberExpression" && !node.computed && node.object.type === "Identifier" && node.object.name === "globalThis" && node.property.type === "Identifier" && node.property.name === "crypto")
|
|
36
|
+
return true;
|
|
37
|
+
if (node.type !== "Identifier")
|
|
38
|
+
return false;
|
|
39
|
+
const variable = variableOf(context, node, node.name);
|
|
40
|
+
if (!variable || variable.defs.length === 0)
|
|
41
|
+
return node.name === "crypto";
|
|
42
|
+
return variable.defs.every((def) => def.type === "ImportBinding" && def.parent.type === "ImportDeclaration" && CRYPTO_MODULES.has(def.parent.source.value) && def.node.type !== "ImportSpecifier");
|
|
43
|
+
};
|
|
43
44
|
/** No id is minted outside `platform/ids`. */
|
|
44
45
|
export const noAmbientId = {
|
|
45
46
|
meta: {
|
|
@@ -51,39 +52,42 @@ export const noAmbientId = {
|
|
|
51
52
|
},
|
|
52
53
|
},
|
|
53
54
|
create(context) {
|
|
54
|
-
const hfs = hfsOf(context)
|
|
55
|
-
const filename = context.filename || context.getFilename()
|
|
56
|
-
if (isOwnedBy(hfs, filename, "platform", "ids"))
|
|
55
|
+
const hfs = hfsOf(context);
|
|
56
|
+
const filename = context.filename || context.getFilename();
|
|
57
|
+
if (isOwnedBy(hfs, filename, "platform", "ids"))
|
|
58
|
+
return {};
|
|
57
59
|
return {
|
|
58
60
|
ImportDeclaration(node) {
|
|
59
|
-
const source = node.source.value
|
|
61
|
+
const source = node.source.value;
|
|
60
62
|
if (CRYPTO_MODULES.has(source)) {
|
|
61
63
|
for (const specifier of node.specifiers) {
|
|
62
|
-
if (specifier.type === "ImportSpecifier" && (specifier.imported
|
|
64
|
+
if (specifier.type === "ImportSpecifier" && importedName(specifier.imported) === "randomUUID")
|
|
65
|
+
context.report({ node: specifier, messageId: "id", data: { call: `randomUUID from ${source}` } });
|
|
63
66
|
}
|
|
64
|
-
return
|
|
67
|
+
return;
|
|
65
68
|
}
|
|
66
|
-
if (!Object.hasOwn(ID_PACKAGES, source))
|
|
67
|
-
|
|
69
|
+
if (!Object.hasOwn(ID_PACKAGES, source))
|
|
70
|
+
return;
|
|
71
|
+
const banned = ID_PACKAGES[source];
|
|
68
72
|
for (const specifier of node.specifiers) {
|
|
69
|
-
const imported = specifier.type === "ImportSpecifier" ? (specifier.imported
|
|
70
|
-
if (banned === null || banned
|
|
73
|
+
const imported = specifier.type === "ImportSpecifier" ? importedName(specifier.imported) : specifier.type === "ImportDefaultSpecifier" ? "default" : "*";
|
|
74
|
+
if (banned === null || banned?.includes(imported) || imported === "*")
|
|
75
|
+
context.report({ node: specifier, messageId: "id", data: { call: `${imported === "default" ? source : imported} from ${source}` } });
|
|
71
76
|
}
|
|
72
77
|
},
|
|
73
78
|
MemberExpression(node) {
|
|
74
|
-
const member = !node.computed && node.property.type === "Identifier" ? node.property.name : node.computed && node.property.type === "Literal" ? node.property.value : null
|
|
75
|
-
if (member === "randomUUID" && isCryptoObject(context, node.object))
|
|
79
|
+
const member = !node.computed && node.property.type === "Identifier" ? node.property.name : node.computed && node.property.type === "Literal" ? node.property.value : null;
|
|
80
|
+
if (member === "randomUUID" && isCryptoObject(context, node.object))
|
|
81
|
+
context.report({ node, messageId: "id", data: { call: "crypto.randomUUID" } });
|
|
76
82
|
},
|
|
77
|
-
}
|
|
83
|
+
};
|
|
78
84
|
},
|
|
79
|
-
}
|
|
80
|
-
|
|
85
|
+
};
|
|
81
86
|
/** The rule this law contributes to the plugin. */
|
|
82
87
|
export const rules = {
|
|
83
88
|
"no-ambient-id": noAmbientId,
|
|
84
|
-
}
|
|
85
|
-
|
|
89
|
+
};
|
|
86
90
|
/** Starts at error: no baseline exists, and the repositories' fix lanes clear the debt with an Ids codemod. */
|
|
87
91
|
export const recommended = {
|
|
88
92
|
"starci-be/no-ambient-id": "error",
|
|
89
|
-
}
|
|
93
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Recommended, RuleModule } from "./lib/rule.js";
|
|
2
|
+
/** Env parsing and options bindings hold no module, queue or scheduler composition. */
|
|
3
|
+
export declare const appOptionsCompositionFree: RuleModule;
|
|
4
|
+
/** R265: app values compose only in typed groups, never in env/options/bootstrap lists. */
|
|
5
|
+
export declare const appCompositionTyped: RuleModule;
|
|
6
|
+
/** R289: the typed app env reader owns parsing; main acquires one source and delegates once. */
|
|
7
|
+
export declare const appEnvRequired: RuleModule;
|
|
8
|
+
/** R289: module lists in the app root contain only spreads of its own compose groups. */
|
|
9
|
+
export declare const appModuleListInline: RuleModule;
|
|
10
|
+
/** Each composition file of an app stays within the line budget its app slot names. */
|
|
11
|
+
export declare const appFileBudget: RuleModule;
|
|
12
|
+
/** The rules this law contributes to the plugin. */
|
|
13
|
+
export declare const rules: {
|
|
14
|
+
"app-options-composition-free": RuleModule;
|
|
15
|
+
"app-composition-typed": RuleModule;
|
|
16
|
+
"app-env-required": RuleModule;
|
|
17
|
+
"app-module-list-inline": RuleModule;
|
|
18
|
+
"app-file-budget": RuleModule;
|
|
19
|
+
};
|
|
20
|
+
/** Every rule starts at error; an app already over a budget migrates its lists into compose/. */
|
|
21
|
+
export declare const recommended: Recommended;
|