@systemfsoftware/oxlint-plugin-effect-platform 2.1.6 → 2.1.8
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 +4 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.mjs +21 -42
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @systemfsoftware/oxlint-plugin-effect-platform
|
|
2
2
|
|
|
3
|
-
# @systemfsoftware/oxlint-plugin-effect-platform@2.1.
|
|
3
|
+
# @systemfsoftware/oxlint-plugin-effect-platform@2.1.8
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Dev dependency bump (@types/node) only; the packed tarball is unchanged.
|
|
6
|
+
|
|
7
|
+
Rebuilt with tsdown 0.23.7 against the updated dev dependencies: the bundled `dist/` files carry a different hashed runtime chunk name and comment markers, and the declared devDependency ranges move. The public API and runtime behaviour are unchanged.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { OxlintOverride } from "oxlint";
|
|
2
|
-
//#region src/index.d.ts
|
|
3
2
|
export declare const noNodeBuiltinImports: NonNullable<OxlintOverride['rules']>['no-restricted-imports'];
|
|
4
3
|
declare const _default: {
|
|
5
4
|
meta: {
|
|
@@ -24,5 +23,4 @@ declare const _default: {
|
|
|
24
23
|
};
|
|
25
24
|
};
|
|
26
25
|
};
|
|
27
|
-
//#endregion
|
|
28
26
|
export { _default as default };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineRule } from "@oxlint/plugins";
|
|
2
2
|
import { Effect, Schema } from "effect";
|
|
3
|
-
|
|
3
|
+
// src/rules/entrypoint-interprets-once.config.ts
|
|
4
4
|
const Options$7 = Schema.Struct({});
|
|
5
5
|
const ENTRYPOINT_FILE$2 = /(?:^|[\\/])main\.ts$/u;
|
|
6
6
|
const RUN_MAIN$1 = "runMain";
|
|
@@ -31,8 +31,7 @@ const meta$9 = {
|
|
|
31
31
|
multipleEdges: INTERPRETS_ONCE_MESSAGE
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
|
|
35
|
-
//#region src/rules/entrypoint-interprets-once.ts
|
|
34
|
+
// src/rules/entrypoint-interprets-once.ts
|
|
36
35
|
const isEntrypointFile$2 = (filename) => ENTRYPOINT_FILE$2.test(filename);
|
|
37
36
|
const edgeName = (callee) => {
|
|
38
37
|
if (callee.type === "Identifier") return callee.name === "runMain" ? RUN_MAIN$1 : null;
|
|
@@ -88,8 +87,7 @@ const entrypointInterpretsOnce = defineRule({
|
|
|
88
87
|
};
|
|
89
88
|
}
|
|
90
89
|
});
|
|
91
|
-
|
|
92
|
-
//#region src/rules/entrypoint-no-exports.config.ts
|
|
90
|
+
// src/rules/entrypoint-no-exports.config.ts
|
|
93
91
|
const Options$6 = Schema.Struct({});
|
|
94
92
|
const ENTRYPOINT_FILE$1 = /(?:^|[\\/])main\.ts$/u;
|
|
95
93
|
const NAMED_EXPORT = "a named export from main.ts";
|
|
@@ -104,8 +102,7 @@ const meta$8 = {
|
|
|
104
102
|
schema: [Options$6],
|
|
105
103
|
messages: { entrypointExport: "{{name}} is forbidden. Expected: {{expected}}. Actual: {{actual}}. Fix: {{fix}}." }
|
|
106
104
|
};
|
|
107
|
-
|
|
108
|
-
//#region src/rules/entrypoint-no-exports.ts
|
|
105
|
+
// src/rules/entrypoint-no-exports.ts
|
|
109
106
|
const isEntrypointFile$1 = (filename) => ENTRYPOINT_FILE$1.test(filename);
|
|
110
107
|
const entrypointNoExports = defineRule({
|
|
111
108
|
meta: meta$8,
|
|
@@ -136,8 +133,7 @@ const entrypointNoExports = defineRule({
|
|
|
136
133
|
};
|
|
137
134
|
}
|
|
138
135
|
});
|
|
139
|
-
|
|
140
|
-
//#region src/rules/entrypoint-no-promise-wrapper.config.ts
|
|
136
|
+
// src/rules/entrypoint-no-promise-wrapper.config.ts
|
|
141
137
|
const Options$5 = Schema.Struct({});
|
|
142
138
|
const ENTRYPOINT_FILE = /(?:^|[\\/])main\.ts$/u;
|
|
143
139
|
const RUN_MAIN = "runMain";
|
|
@@ -151,8 +147,7 @@ const meta$7 = {
|
|
|
151
147
|
schema: [Options$5],
|
|
152
148
|
messages: { promiseWrapper: "{{name}} is forbidden. Expected: {{expected}}. Actual: {{actual}}. Fix: {{fix}}." }
|
|
153
149
|
};
|
|
154
|
-
|
|
155
|
-
//#region src/rules/entrypoint-no-promise-wrapper.ts
|
|
150
|
+
// src/rules/entrypoint-no-promise-wrapper.ts
|
|
156
151
|
const isEntrypointFile = (filename) => ENTRYPOINT_FILE.test(filename);
|
|
157
152
|
const isRunMainCallee = (callee) => {
|
|
158
153
|
if (callee.type === "Identifier") return callee.name === RUN_MAIN;
|
|
@@ -196,15 +191,13 @@ const entrypointNoPromiseWrapper = defineRule({
|
|
|
196
191
|
} };
|
|
197
192
|
}
|
|
198
193
|
});
|
|
199
|
-
|
|
200
|
-
//#region src/rules/entrypoint-not-imported.config.ts
|
|
194
|
+
// src/rules/entrypoint-not-imported.config.ts
|
|
201
195
|
const Options$4 = Schema.Struct({});
|
|
202
196
|
const MAIN_MODULE_SOURCE = /(?:^|\/)main(?:\.[cm]?[jt]sx?)?$/u;
|
|
203
197
|
const ENTRYPOINT_IMPORT_EXPECTED = "the entrypoint imported by nothing - the process interprets it, no module consumes it";
|
|
204
198
|
const ENTRYPOINT_IMPORT_ACTUAL = "an import of main.ts";
|
|
205
199
|
const ENTRYPOINT_IMPORT_FIX = "import the cell that owns the binding instead; if main.ts is the only place it exists, it was never an entrypoint - move the behavior into an executor, adapter, or layer and leave main.ts holding only the interpretation edge";
|
|
206
|
-
|
|
207
|
-
//#region src/rules/entrypoint-not-imported.ts
|
|
200
|
+
// src/rules/entrypoint-not-imported.ts
|
|
208
201
|
const entrypointNotImported = defineRule({
|
|
209
202
|
meta: {
|
|
210
203
|
type: "problem",
|
|
@@ -278,8 +271,7 @@ const CONSOLE_LOG_METHODS = /* @__PURE__ */ new Set([
|
|
|
278
271
|
"info",
|
|
279
272
|
"debug"
|
|
280
273
|
]);
|
|
281
|
-
|
|
282
|
-
//#region src/rules/no-logging-in-catch.ts
|
|
274
|
+
// src/rules/no-logging-in-catch.ts
|
|
283
275
|
const noLoggingInCatch = defineRule({
|
|
284
276
|
meta: {
|
|
285
277
|
type: "suggestion",
|
|
@@ -377,8 +369,7 @@ const noLoggingInCatch = defineRule({
|
|
|
377
369
|
};
|
|
378
370
|
}
|
|
379
371
|
});
|
|
380
|
-
|
|
381
|
-
//#region src/rules/no-native-map-in-effect.config.ts
|
|
372
|
+
// src/rules/no-native-map-in-effect.config.ts
|
|
382
373
|
const Options$3 = Schema.Struct({
|
|
383
374
|
allow: Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultType(Effect.succeed([]))),
|
|
384
375
|
expected: Schema.String.pipe(Schema.withDecodingDefaultType(Effect.succeed("HashMap from effect (HashMap.empty() or HashMap.fromIterable())"))),
|
|
@@ -390,8 +381,7 @@ const meta$4 = {
|
|
|
390
381
|
schema: [Schema.toJsonSchemaDocument(Options$3).schema],
|
|
391
382
|
messages: { forbiddenMap: "{{actual}} is forbidden when Effect is imported. Expected: {{expected}}. Actual: {{actual}}. Fix: {{fix}}." }
|
|
392
383
|
};
|
|
393
|
-
|
|
394
|
-
//#region src/rules/no-native-map-in-effect.ts
|
|
384
|
+
// src/rules/no-native-map-in-effect.ts
|
|
395
385
|
const isEffectImport$1 = (sourceValue) => sourceValue === "effect" || sourceValue.startsWith("effect/") || sourceValue.startsWith("@effect/");
|
|
396
386
|
const isInsideEffectGen$1 = (node) => {
|
|
397
387
|
if (node == null) return false;
|
|
@@ -433,8 +423,7 @@ const noNativeMapInEffect = defineRule({
|
|
|
433
423
|
};
|
|
434
424
|
}
|
|
435
425
|
});
|
|
436
|
-
|
|
437
|
-
//#region src/rules/no-native-set-in-effect.config.ts
|
|
426
|
+
// src/rules/no-native-set-in-effect.config.ts
|
|
438
427
|
const Options$2 = Schema.Struct({
|
|
439
428
|
allow: Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultType(Effect.succeed([]))),
|
|
440
429
|
expected: Schema.String.pipe(Schema.withDecodingDefaultType(Effect.succeed("HashSet from effect (HashSet.empty() or HashSet.fromIterable())"))),
|
|
@@ -446,8 +435,7 @@ const meta$3 = {
|
|
|
446
435
|
schema: [Schema.toJsonSchemaDocument(Options$2).schema],
|
|
447
436
|
messages: { forbiddenSet: "{{actual}} is forbidden when Effect is imported. Expected: {{expected}}. Actual: {{actual}}. Fix: {{fix}}." }
|
|
448
437
|
};
|
|
449
|
-
|
|
450
|
-
//#region src/rules/no-native-set-in-effect.ts
|
|
438
|
+
// src/rules/no-native-set-in-effect.ts
|
|
451
439
|
const isSetCallee = (callee) => callee.type === "Identifier" && callee.name === "Set";
|
|
452
440
|
const isEffectImport = (sourceValue) => sourceValue === "effect" || sourceValue.startsWith("effect/") || sourceValue.startsWith("@effect/");
|
|
453
441
|
const isInsideEffectGen = (node) => {
|
|
@@ -485,8 +473,7 @@ const noNativeSetInEffect = defineRule({
|
|
|
485
473
|
};
|
|
486
474
|
}
|
|
487
475
|
});
|
|
488
|
-
|
|
489
|
-
//#region src/rules/no-new-worker-with-wasm-import.config.ts
|
|
476
|
+
// src/rules/no-new-worker-with-wasm-import.config.ts
|
|
490
477
|
const Options$1 = Schema.Struct({
|
|
491
478
|
wasmImportPatterns: Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultType(Effect.succeed([/^(@[^/]+\/)?[^/]+-wasm(\/.*)?$/].map((re) => re.source)))),
|
|
492
479
|
expected: Schema.String.pipe(Schema.withDecodingDefaultType(Effect.succeed("Bun.spawn subprocess pool"))),
|
|
@@ -498,8 +485,7 @@ const meta$2 = {
|
|
|
498
485
|
schema: [Schema.toJsonSchemaDocument(Options$1).schema],
|
|
499
486
|
messages: { forbiddenNewWorkerWithWasm: "{{actual}} is forbidden when a WASM module is imported. Expected: {{expected}}. Actual: {{actual}}. Fix: {{fix}}." }
|
|
500
487
|
};
|
|
501
|
-
|
|
502
|
-
//#region src/rules/no-new-worker-with-wasm-import.ts
|
|
488
|
+
// src/rules/no-new-worker-with-wasm-import.ts
|
|
503
489
|
const isWasmImport = (sourceValue, patterns) => patterns.some((re) => re.test(sourceValue));
|
|
504
490
|
const isNewWorkerCall = (node) => {
|
|
505
491
|
if (node.callee.type !== "Identifier" || node.callee.name !== "Worker") return false;
|
|
@@ -532,8 +518,7 @@ const noNewWorkerWithWasmImport = defineRule({
|
|
|
532
518
|
};
|
|
533
519
|
}
|
|
534
520
|
});
|
|
535
|
-
|
|
536
|
-
//#region src/rules/no-unported-time-source.config.ts
|
|
521
|
+
// src/rules/no-unported-time-source.config.ts
|
|
537
522
|
const Options = Schema.Struct({ ports: Schema.Array(Schema.String).pipe(Schema.withDecodingDefaultType(Effect.succeed([]))) });
|
|
538
523
|
const TIME_SOURCE_MESSAGE = "{{name}} is forbidden. Expected: {{expected}}. Actual: {{actual}}. Fix: {{fix}}.";
|
|
539
524
|
const TIME_SOURCE_EXPECTED = "time, scheduling, and randomness reached through a named, replaceable port — a file listed in this rule's `ports` option, or a source injected as a parameter";
|
|
@@ -580,8 +565,7 @@ const meta$1 = {
|
|
|
580
565
|
schema: [Schema.toJsonSchemaDocument(Options).schema],
|
|
581
566
|
messages: { unportedTimeSource: TIME_SOURCE_MESSAGE }
|
|
582
567
|
};
|
|
583
|
-
|
|
584
|
-
//#region src/rules/no-unported-time-source.ts
|
|
568
|
+
// src/rules/no-unported-time-source.ts
|
|
585
569
|
const isScopeLike$1 = (value) => typeof value === "object" && value !== null && "references" in value && "upper" in value;
|
|
586
570
|
const isIdentifierNode = (node) => node.type === "Identifier";
|
|
587
571
|
const decodeOptions = (input) => Effect.runSync(Effect.orDie(Schema.decodeUnknownEffect(Options)(input)));
|
|
@@ -681,8 +665,7 @@ const noUnportedTimeSource = defineRule({
|
|
|
681
665
|
};
|
|
682
666
|
}
|
|
683
667
|
});
|
|
684
|
-
|
|
685
|
-
//#region ../import-origin/dist/index.mjs
|
|
668
|
+
// ../import-origin/dist/index.mjs
|
|
686
669
|
const isScopeLike = (value) => typeof value === "object" && value !== null && "references" in value && "upper" in value;
|
|
687
670
|
const isIdentifier = (node) => node.type === "Identifier";
|
|
688
671
|
const isMemberExpression = (node) => node.type === "MemberExpression";
|
|
@@ -876,8 +859,7 @@ const resolveIdentifierOrigin = (identifier, getScope, depth) => {
|
|
|
876
859
|
}
|
|
877
860
|
return base;
|
|
878
861
|
};
|
|
879
|
-
|
|
880
|
-
//#region src/rules/runtime-construction-placement.config.ts
|
|
862
|
+
// src/rules/runtime-construction-placement.config.ts
|
|
881
863
|
const isRuntimeCodeFile = (filename) => /(?:^|[\\/])src[\\/]/u.test(filename) || filename.endsWith(".test.ts");
|
|
882
864
|
const isInterpretationEdge = (filename) => /(?:^|[\\/])main\.ts$/u.test(filename);
|
|
883
865
|
const EFFECT_MODULE = "effect";
|
|
@@ -911,8 +893,7 @@ const meta = {
|
|
|
911
893
|
eagerConstruction: PLACEMENT_MESSAGE
|
|
912
894
|
}
|
|
913
895
|
};
|
|
914
|
-
|
|
915
|
-
//#region src/rules/runtime-construction-placement.ts
|
|
896
|
+
// src/rules/runtime-construction-placement.ts
|
|
916
897
|
const isFunctionNode = (node) => node.type === "FunctionDeclaration" || node.type === "FunctionExpression" || node.type === "ArrowFunctionExpression";
|
|
917
898
|
const staticMemberNameOf = (member) => {
|
|
918
899
|
if (member.computed === true) {
|
|
@@ -1135,8 +1116,7 @@ const runtimeConstructionPlacement = defineRule({
|
|
|
1135
1116
|
};
|
|
1136
1117
|
}
|
|
1137
1118
|
});
|
|
1138
|
-
|
|
1139
|
-
//#region src/index.ts
|
|
1119
|
+
// src/index.ts
|
|
1140
1120
|
const PLUGIN_NAME = "@systemfsoftware/oxlint-plugin-effect-platform";
|
|
1141
1121
|
const rule = (name) => `${PLUGIN_NAME}/${name}`;
|
|
1142
1122
|
/** The files that own the process timers, clocks, and randomness the rest of production source must reach through them. */
|
|
@@ -1201,5 +1181,4 @@ var src_default = {
|
|
|
1201
1181
|
}]
|
|
1202
1182
|
} }
|
|
1203
1183
|
};
|
|
1204
|
-
//#endregion
|
|
1205
1184
|
export { src_default as default, noNodeBuiltinImports };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/oxlint-plugin-effect-platform",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.8",
|
|
5
5
|
"author": "Ryan Lee <drdgvhbh@gmail.com>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -37,30 +37,30 @@
|
|
|
37
37
|
"./package.json": "./package.json"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@oxc-project/types": "^0.
|
|
40
|
+
"@oxc-project/types": "^0.159.0",
|
|
41
41
|
"@oxlint/plugins": "~1.93.0",
|
|
42
42
|
"oxlint": "~1.93.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@microsoft/api-extractor": "^7.
|
|
45
|
+
"@microsoft/api-extractor": "^7.60.1",
|
|
46
46
|
"@systemfsoftware/arethetypeswrong-cli": "^4.2.0",
|
|
47
|
-
"@systemfsoftware/oxlint-config-rule-authoring": "^3.0.
|
|
47
|
+
"@systemfsoftware/oxlint-config-rule-authoring": "^3.0.3",
|
|
48
48
|
"@systemfsoftware/oxlint-import-origin": "^0.1.0",
|
|
49
49
|
"@systemfsoftware/tsconfig": "^2.1.0",
|
|
50
|
-
"@systemfsoftware/tsdown-config": "^0.1.
|
|
51
|
-
"@systemfsoftware/vitest-config": "^0.1.
|
|
52
|
-
"@types/node": "^26.6.
|
|
50
|
+
"@systemfsoftware/tsdown-config": "^0.1.3",
|
|
51
|
+
"@systemfsoftware/vitest-config": "^0.1.4",
|
|
52
|
+
"@types/node": "^26.6.6",
|
|
53
53
|
"@vitest/coverage-v8": "^5.1.0",
|
|
54
|
-
"effect": "^4.1.
|
|
54
|
+
"effect": "^4.1.4",
|
|
55
55
|
"fast-check": "^4.10.2",
|
|
56
56
|
"oxlint": "~1.93.0",
|
|
57
|
-
"rimraf": "^6.1.
|
|
58
|
-
"tsdown": "^0.23.
|
|
57
|
+
"rimraf": "^6.1.4",
|
|
58
|
+
"tsdown": "^0.23.7",
|
|
59
59
|
"typescript": "^7.0.2",
|
|
60
60
|
"vitest": "^5.1.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"effect": "^4.1.
|
|
63
|
+
"effect": "^4.1.4",
|
|
64
64
|
"typescript": ">=5.0.0"
|
|
65
65
|
},
|
|
66
66
|
"publishConfig": {
|