@milkenjoyer/toolchain 0.14.1 → 0.15.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 +13 -17
- package/dist/effect-plugin-BsrW5_nI.mjs +79 -0
- package/dist/effect-plugin.d.mts +2 -3966
- package/dist/effect-plugin.mjs +1 -1
- package/dist/fmt-BaECz64m.mjs +8 -0
- package/dist/fmt.mjs +1 -8
- package/dist/formal.mjs +1 -1
- package/dist/guard-Doqk4Fju.mjs +143 -0
- package/dist/guard.mjs +1 -96
- package/dist/{lint-IhmtnBbx.mjs → lint-CfztB4u8.mjs} +1 -1
- package/dist/lint.mjs +1 -1
- package/dist/standard.mjs +557 -4
- package/package.json +4 -9
- package/src/arithmetic.ts +60 -0
- package/src/compatible.ts +512 -0
- package/src/conformance.ts +56 -0
- package/src/effect-plugin.ts +24 -0
- package/src/effect-tsgo.ts +44 -0
- package/src/exceptions.ts +17 -0
- package/src/fmt.ts +13 -0
- package/src/foldkit-plugin.ts +51 -0
- package/src/guard.ts +307 -0
- package/src/hooks.ts +205 -0
- package/src/index.ts +1 -0
- package/src/knip.ts +25 -0
- package/src/lint.ts +170 -0
- package/src/plugin.ts +21 -0
- package/src/rules/no-comments.ts +36 -0
- package/src/rules/no-process-env.ts +68 -0
- package/src/rules/prefer-accessible-scene-locators.ts +227 -0
- package/src/rules/require-command-answer-names.ts +144 -0
- package/src/rules/require-past-tense-messages.ts +201 -0
- package/src/rules/use-temp-file-scoped.ts +132 -0
- package/src/rules.ts +121 -0
- package/src/shared/foldkit-api.ts +51 -0
- package/src/shared/member-path.ts +106 -0
- package/src/shared/syntax.ts +47 -0
- package/src/standard/alchemy.ts +70 -0
- package/src/standard/checks.ts +10 -1
- package/src/standard/config.ts +84 -0
- package/src/standard/domain-rules.ts +204 -0
- package/src/standard/domain.ts +296 -0
- package/src/standard/infra.ts +486 -0
- package/src/versions.ts +221 -0
- package/dist/effect-plugin-BXUx9PPu.mjs +0 -3561
- package/dist/manifest-xQwgnYI1.mjs +0 -53
package/README.md
CHANGED
|
@@ -252,20 +252,16 @@ Rule 16 applies once `specs.json` has an `arithmetic` key. Each `arithmetic` glo
|
|
|
252
252
|
|
|
253
253
|
## Standard check
|
|
254
254
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
- `
|
|
260
|
-
- `
|
|
261
|
-
- `
|
|
262
|
-
- `
|
|
263
|
-
- `
|
|
264
|
-
- `
|
|
265
|
-
- `
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
- `task-agents` requires a Task agents section with one line pointing to `agent-kit:task-agents`.
|
|
269
|
-
- `skill-names` rejects repo skills that share plugin skill names.
|
|
270
|
-
|
|
271
|
-
New rules register in `src/standard/checks.ts`.
|
|
255
|
+
`vp exec standard`: sorted `<file>: <rule>: <message>` stderr for tracked files (exit 1). Success exits 0; arguments exit 2.
|
|
256
|
+
|
|
257
|
+
- `toolchain-pin`, `exact-versions`, `alchemy-pins`: exact pins; one Alchemy.
|
|
258
|
+
- `lint-package`, `lint-fmt`, `lint-config`: shared lint/fmt, ignores, one-provide; no local lint package.
|
|
259
|
+
- `tsconfig-base`, `node-version`, `renovate-preset`: shared presets.
|
|
260
|
+
- `specs`, `ready-formal`: metadata, critical coverage, formal gate.
|
|
261
|
+
- `task-agents`, `skill-names`: pointer; unique names.
|
|
262
|
+
- `infra-through-alchemy`: no provider writes/Wrangler; reads/runtime allowed.
|
|
263
|
+
- `domain-layout`: placement, shared events/rejections, imported `.id.ts` ids.
|
|
264
|
+
- `domain-imports`: own files, domain, effect, `standard.domainImports`.
|
|
265
|
+
- `domain-no-throw`: Domain.Rejection/Schema.TaggedError.
|
|
266
|
+
|
|
267
|
+
Source checks skip tests/proofs. Runtime story coverage is tracked in #325.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { n as memberPropertyName } from "./syntax-CGEOffZK.mjs";
|
|
2
|
+
import * as Arr from "effect/Array";
|
|
3
|
+
import * as Option from "effect/Option";
|
|
4
|
+
import * as R from "effect/Record";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import upstream from "@mpsuesser/oxlint-plugin-effect";
|
|
7
|
+
import { Diagnostic, Rule, RuleContext } from "effect-oxlint";
|
|
8
|
+
// src/rules/use-temp-file-scoped.ts
|
|
9
|
+
const isOs = (source) => source === "os" || source === "node:os";
|
|
10
|
+
const isOsBinding = (source, node) => {
|
|
11
|
+
const lookup = (scope) => {
|
|
12
|
+
const variable = scope.set.get(node.name);
|
|
13
|
+
if (variable === void 0) return scope.upper === null ? false : lookup(scope.upper);
|
|
14
|
+
return Arr.some(variable.defs, (definition) => definition.type === "ImportBinding" && (definition.node.type === "ImportDefaultSpecifier" || definition.node.type === "ImportNamespaceSpecifier") && definition.parent?.type === "ImportDeclaration" && isOs(definition.parent.source.value));
|
|
15
|
+
};
|
|
16
|
+
return lookup(source.getScope(node));
|
|
17
|
+
};
|
|
18
|
+
const isManagedAcquire = (node) => {
|
|
19
|
+
const parent = node.parent;
|
|
20
|
+
if (parent === null) return false;
|
|
21
|
+
if (parent.type === "CallExpression" && parent.arguments[0] === node && parent.callee.type === "MemberExpression" && parent.callee.object.type === "Identifier" && parent.callee.object.name === "Effect" && Option.exists(memberPropertyName(parent.callee), (name) => name === "acquireRelease" || name === "acquireUseRelease")) return true;
|
|
22
|
+
return isManagedAcquire(parent);
|
|
23
|
+
};
|
|
24
|
+
const useTempFileScopedRule = Rule.define({
|
|
25
|
+
name: "use-temp-file-scoped",
|
|
26
|
+
meta: Rule.meta({
|
|
27
|
+
type: "suggestion",
|
|
28
|
+
description: "Prefer scoped temporary files and directories with automatic cleanup",
|
|
29
|
+
messages: {
|
|
30
|
+
tmpdir: "Avoid `os.tmpdir()` — use `FileSystem.makeTempFileScoped` from `@effect/platform` for scoped temp files with automatic cleanup.",
|
|
31
|
+
unscoped: "Avoid `{{api}}` — the unscoped variant requires manual cleanup. Use `{{api}}Scoped` so the resource is finalized when its scope closes."
|
|
32
|
+
}
|
|
33
|
+
}),
|
|
34
|
+
*create() {
|
|
35
|
+
const context = yield* RuleContext;
|
|
36
|
+
return {
|
|
37
|
+
ImportDeclaration: (node) => node.type === "ImportDeclaration" && isOs(node.source.value) ? Effect.forEach(Arr.filter(node.specifiers, (specifier) => specifier.type === "ImportSpecifier" && (specifier.imported.type === "Identifier" ? specifier.imported.name : specifier.imported.value) === "tmpdir"), (specifier) => context.report(Diagnostic.fromId({
|
|
38
|
+
node: specifier,
|
|
39
|
+
messageId: "tmpdir"
|
|
40
|
+
})), {
|
|
41
|
+
concurrency: 1,
|
|
42
|
+
discard: true
|
|
43
|
+
}) : Effect.void,
|
|
44
|
+
MemberExpression: (node) => node.type === "MemberExpression" && Option.contains(memberPropertyName(node), "tmpdir") && node.object.type === "Identifier" && isOsBinding(context.sourceCode, node.object) ? context.report(Diagnostic.fromId({
|
|
45
|
+
node,
|
|
46
|
+
messageId: "tmpdir"
|
|
47
|
+
})) : Effect.void,
|
|
48
|
+
CallExpression: (node) => {
|
|
49
|
+
if (node.type !== "CallExpression" || node.callee.type !== "MemberExpression" || isManagedAcquire(node)) return Effect.void;
|
|
50
|
+
return Option.match(Option.filter(memberPropertyName(node.callee), (name) => name === "makeTempFile" || name === "makeTempDirectory"), {
|
|
51
|
+
onNone: () => Effect.void,
|
|
52
|
+
onSome: (api) => context.report(Diagnostic.fromId({
|
|
53
|
+
node,
|
|
54
|
+
messageId: "unscoped",
|
|
55
|
+
data: { api }
|
|
56
|
+
}))
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
// src/effect-plugin.ts
|
|
63
|
+
const kept = [
|
|
64
|
+
"avoid-mutable-state",
|
|
65
|
+
"avoid-option-getorthrow",
|
|
66
|
+
"no-chained-type-assertions",
|
|
67
|
+
"no-module-mocking",
|
|
68
|
+
"prefer-redacted-config",
|
|
69
|
+
"require-effect-concurrency",
|
|
70
|
+
"throw-in-effect-gen"
|
|
71
|
+
];
|
|
72
|
+
const plugin = {
|
|
73
|
+
meta: upstream.meta,
|
|
74
|
+
rules: {
|
|
75
|
+
...R.filter(upstream.rules, (_rule, name) => kept.includes(name)),
|
|
76
|
+
"use-temp-file-scoped": useTempFileScopedRule
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
export { plugin as t };
|