@foldkit/oxlint-plugin 0.12.1 → 0.13.0-canary.1863b929fe7e
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/all.json +14 -0
- package/dist/guards.d.ts +1 -0
- package/dist/guards.d.ts.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3095 -1131
- package/dist/rules/acquire-release-constructs-in-acquire-body.d.ts +8 -0
- package/dist/rules/acquire-release-constructs-in-acquire-body.d.ts.map +1 -0
- package/dist/rules/no-child-message-construction-in-root.d.ts +2 -2
- package/dist/rules/no-child-message-construction-in-root.d.ts.map +1 -1
- package/dist/rules/no-direct-submodel-state-update.d.ts +3 -0
- package/dist/rules/no-direct-submodel-state-update.d.ts.map +1 -0
- package/dist/rules/no-prevent-default-in-stream-operator.d.ts +12 -0
- package/dist/rules/no-prevent-default-in-stream-operator.d.ts.map +1 -0
- package/dist/rules/no-route-query-constructor-default.d.ts +7 -0
- package/dist/rules/no-route-query-constructor-default.d.ts.map +1 -0
- package/dist/rules/no-switch-on-message-tag.d.ts +7 -0
- package/dist/rules/no-switch-on-message-tag.d.ts.map +1 -0
- package/dist/rules/prefer-command-mapmessage.d.ts +8 -0
- package/dist/rules/prefer-command-mapmessage.d.ts.map +1 -0
- package/dist/rules/prefer-option-over-nullable-in-model.d.ts +8 -0
- package/dist/rules/prefer-option-over-nullable-in-model.d.ts.map +1 -0
- package/dist/rules/require-fold-for-child-update-result.d.ts +6 -0
- package/dist/rules/require-fold-for-child-update-result.d.ts.map +1 -0
- package/package.json +4 -3
- package/recommended.json +14 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Requires the acquire Effect of Effect.acquireRelease to construct its
|
|
3
|
+
* resource in place. Flags an acquire that merely returns a pre-existing
|
|
4
|
+
* identifier or uses eager Effect.succeed, which leaks the handle if
|
|
5
|
+
* interruption strikes between construction and acquire.
|
|
6
|
+
*/
|
|
7
|
+
export declare const acquireReleaseConstructsInAcquireBody: import("effect-oxlint").CreateRule;
|
|
8
|
+
//# sourceMappingURL=acquire-release-constructs-in-acquire-body.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acquire-release-constructs-in-acquire-body.d.ts","sourceRoot":"","sources":["../../src/rules/acquire-release-constructs-in-acquire-body.ts"],"names":[],"mappings":"AAkEA;;;;;GAKG;AACH,eAAO,MAAM,qCAAqC,oCA+BhD,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flags
|
|
3
|
-
*
|
|
2
|
+
* Flags construction of a child Submodel Message variant from outside the
|
|
3
|
+
* child, such as Chat.Message.ClickedOpen(...) or an immutable local alias.
|
|
4
4
|
*/
|
|
5
5
|
export declare const noChildMessageConstructionInRoot: import("effect-oxlint").CreateRule;
|
|
6
6
|
//# sourceMappingURL=no-child-message-construction-in-root.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-child-message-construction-in-root.d.ts","sourceRoot":"","sources":["../../src/rules/no-child-message-construction-in-root.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"no-child-message-construction-in-root.d.ts","sourceRoot":"","sources":["../../src/rules/no-child-message-construction-in-root.ts"],"names":[],"mappings":"AA+YA;;;GAGG;AACH,eAAO,MAAM,gCAAgC,oCA0C3C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-direct-submodel-state-update.d.ts","sourceRoot":"","sources":["../../src/rules/no-direct-submodel-state-update.ts"],"names":[],"mappings":"AAuyBA,gFAAgF;AAChF,eAAO,MAAM,2BAA2B,oCA+DtC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flags `event.preventDefault()` inside callbacks passed to Stream operators
|
|
3
|
+
* (`Stream.map`, `Stream.mapEffect`, `Stream.filterMap`,
|
|
4
|
+
* `Stream.filterMapEffect`, `Stream.filter`, `Stream.filterEffect`,
|
|
5
|
+
* `Stream.tap`).
|
|
6
|
+
* Those callbacks do not reliably run inside the browser's event dispatch.
|
|
7
|
+
* For a DOM-event Stream, cancellation belongs inside the native listener,
|
|
8
|
+
* which is where `Subscription.fromEventFilterMapPreventDefault` runs its
|
|
9
|
+
* mapper.
|
|
10
|
+
*/
|
|
11
|
+
export declare const noPreventDefaultInStreamOperator: import("effect-oxlint").CreateRule;
|
|
12
|
+
//# sourceMappingURL=no-prevent-default-in-stream-operator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-prevent-default-in-stream-operator.d.ts","sourceRoot":"","sources":["../../src/rules/no-prevent-default-in-stream-operator.ts"],"names":[],"mappings":"AAuJA;;;;;;;;;GASG;AACH,eAAO,MAAM,gCAAgC,oCA+C3C,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Forbids Schema.withConstructorDefault on Route.query fields. Constructor
|
|
3
|
+
* defaults run only during Schema construction, while Route.query decodes and
|
|
4
|
+
* encodes, so the annotation has no effect on a missing query parameter.
|
|
5
|
+
*/
|
|
6
|
+
export declare const noRouteQueryConstructorDefault: import("effect-oxlint").CreateRule;
|
|
7
|
+
//# sourceMappingURL=no-route-query-constructor-default.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-route-query-constructor-default.d.ts","sourceRoot":"","sources":["../../src/rules/no-route-query-constructor-default.ts"],"names":[],"mappings":"AA0FA;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,oCAuCzC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Forbids `switch (x._tag)` in favor of the tagged union's match helper or
|
|
3
|
+
* Effect Match, whose exhaustiveness check turns a forgotten Message or state
|
|
4
|
+
* variant into a compile error instead of a silent runtime fall-through.
|
|
5
|
+
*/
|
|
6
|
+
export declare const noSwitchOnMessageTag: import("effect-oxlint").CreateRule;
|
|
7
|
+
//# sourceMappingURL=no-switch-on-message-tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-switch-on-message-tag.d.ts","sourceRoot":"","sources":["../../src/rules/no-switch-on-message-tag.ts"],"names":[],"mappings":"AAqBA;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,oCA2B/B,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Forbids lifting a Command's result Message through Command.mapEffect via an
|
|
3
|
+
* Effect.map that returns a Message constructor call. Manual wrapping fuses
|
|
4
|
+
* into the Effect but records nothing on the message-mapping chain that Story
|
|
5
|
+
* and Scene resolve replay. Use Command.mapMessage or Command.mapMessages.
|
|
6
|
+
*/
|
|
7
|
+
export declare const preferCommandMapmessage: import("effect-oxlint").CreateRule;
|
|
8
|
+
//# sourceMappingURL=prefer-command-mapmessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefer-command-mapmessage.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-command-mapmessage.ts"],"names":[],"mappings":"AA+QA;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,oCAqClC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Flags null, undefined, and optional field encodings inside the Model schema,
|
|
3
|
+
* where absence must be modeled with Schema.Option. The rule is gated to a
|
|
4
|
+
* const Model = Schema.Struct({...}) binding so wire and API schemas that
|
|
5
|
+
* legitimately use null are left alone.
|
|
6
|
+
*/
|
|
7
|
+
export declare const preferOptionOverNullableInModel: import("effect-oxlint").CreateRule;
|
|
8
|
+
//# sourceMappingURL=prefer-option-over-nullable-in-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefer-option-over-nullable-in-model.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-option-over-nullable-in-model.ts"],"names":[],"mappings":"AAiIA;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,oCAoD1C,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Flags a parent that copies a namespaced child helper or update Return's Model
|
|
2
|
+
* into the matching evo field. It requires a matching Update.foldChild or
|
|
3
|
+
* Update.foldChildStep reference in the file, and leaves ordinary helpers,
|
|
4
|
+
* direct imports, aliases, init assembly, and Model-only reflect helpers alone. */
|
|
5
|
+
export declare const requireFoldForChildUpdateResult: import("effect-oxlint").CreateRule;
|
|
6
|
+
//# sourceMappingURL=require-fold-for-child-update-result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-fold-for-child-update-result.d.ts","sourceRoot":"","sources":["../../src/rules/require-fold-for-child-update-result.ts"],"names":[],"mappings":"AA+bA;;;oFAGoF;AACpF,eAAO,MAAM,+BAA+B,oCAiJ1C,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@foldkit/oxlint-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0-canary.1863b929fe7e",
|
|
4
4
|
"description": "Oxlint rules for Foldkit applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "^26.4.0",
|
|
22
22
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
23
|
-
"effect": "4.0.0-rc.
|
|
23
|
+
"effect": "4.0.0-rc.115",
|
|
24
24
|
"rimraf": "^6.1.3",
|
|
25
25
|
"rolldown": "^1.2.6",
|
|
26
26
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
"scripts": {
|
|
54
54
|
"clean": "rimraf dist recommended.json all.json *.tsbuildinfo",
|
|
55
55
|
"build": "pnpm run clean && rolldown -c rolldown.config.ts && tsc -b tsconfig.build.json && node scripts/generate-presets.mjs",
|
|
56
|
-
"test": "vitest run",
|
|
56
|
+
"test": "pnpm run typecheck:real-oxlint-fixtures && vitest run",
|
|
57
|
+
"typecheck:real-oxlint-fixtures": "node scripts/typecheck-real-oxlint-fixtures.mjs",
|
|
57
58
|
"typecheck": "tsc --noEmit"
|
|
58
59
|
}
|
|
59
60
|
}
|
package/recommended.json
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
}
|
|
7
7
|
],
|
|
8
8
|
"rules": {
|
|
9
|
+
"foldkit/acquire-release-constructs-in-acquire-body": "error",
|
|
9
10
|
"foldkit/command-binding-matches-name": "error",
|
|
10
11
|
"foldkit/command-define-pascal-const": "error",
|
|
11
12
|
"foldkit/got-prefix-requires-submodel-payload": "error",
|
|
@@ -16,6 +17,7 @@
|
|
|
16
17
|
"foldkit/mount-factory-must-use-element": "error",
|
|
17
18
|
"foldkit/no-array-index-view-keys": "error",
|
|
18
19
|
"foldkit/no-child-message-construction-in-root": "error",
|
|
20
|
+
"foldkit/no-direct-submodel-state-update": "error",
|
|
19
21
|
"foldkit/no-disabling-dev-guardrails": "error",
|
|
20
22
|
"foldkit/no-duplicate-onmount-per-element": "error",
|
|
21
23
|
"foldkit/no-empty-children-array": "error",
|
|
@@ -28,10 +30,16 @@
|
|
|
28
30
|
"foldkit/no-module-level-mutable-state": "error",
|
|
29
31
|
"foldkit/no-nonportable-server-globals": "off",
|
|
30
32
|
"foldkit/no-noop-message": "error",
|
|
33
|
+
"foldkit/no-prevent-default-in-stream-operator": "error",
|
|
31
34
|
"foldkit/no-raw-dom-event-attributes": "error",
|
|
35
|
+
"foldkit/no-route-query-constructor-default": "error",
|
|
32
36
|
"foldkit/no-spread-in-evo": "error",
|
|
37
|
+
"foldkit/no-switch-on-message-tag": "error",
|
|
33
38
|
"foldkit/prefer-callable-message-constructor": "error",
|
|
39
|
+
"foldkit/prefer-command-mapmessage": "error",
|
|
34
40
|
"foldkit/prefer-effect-module-names": "error",
|
|
41
|
+
"foldkit/prefer-option-over-nullable-in-model": "error",
|
|
42
|
+
"foldkit/require-fold-for-child-update-result": "error",
|
|
35
43
|
"foldkit/require-rel-for-external-link": "error",
|
|
36
44
|
"foldkit/selection-submodel-factory-at-module-scope": "error",
|
|
37
45
|
"foldkit/wrap-child-output-in-got-message": "error"
|
|
@@ -94,6 +102,7 @@
|
|
|
94
102
|
"foldkit/mount-factory-must-use-element": "off",
|
|
95
103
|
"foldkit/no-array-index-view-keys": "off",
|
|
96
104
|
"foldkit/no-child-message-construction-in-root": "off",
|
|
105
|
+
"foldkit/no-direct-submodel-state-update": "off",
|
|
97
106
|
"foldkit/no-disabling-dev-guardrails": "off",
|
|
98
107
|
"foldkit/no-duplicate-onmount-per-element": "off",
|
|
99
108
|
"foldkit/no-empty-children-array": "off",
|
|
@@ -106,9 +115,14 @@
|
|
|
106
115
|
"foldkit/no-module-level-mutable-state": "off",
|
|
107
116
|
"foldkit/no-nonportable-server-globals": "off",
|
|
108
117
|
"foldkit/no-noop-message": "off",
|
|
118
|
+
"foldkit/no-prevent-default-in-stream-operator": "off",
|
|
109
119
|
"foldkit/no-raw-dom-event-attributes": "off",
|
|
120
|
+
"foldkit/no-route-query-constructor-default": "off",
|
|
110
121
|
"foldkit/no-spread-in-evo": "off",
|
|
111
122
|
"foldkit/prefer-callable-message-constructor": "off",
|
|
123
|
+
"foldkit/prefer-command-mapmessage": "off",
|
|
124
|
+
"foldkit/prefer-option-over-nullable-in-model": "off",
|
|
125
|
+
"foldkit/require-fold-for-child-update-result": "off",
|
|
112
126
|
"foldkit/require-rel-for-external-link": "off",
|
|
113
127
|
"foldkit/selection-submodel-factory-at-module-scope": "off",
|
|
114
128
|
"foldkit/wrap-child-output-in-got-message": "off"
|