@foldkit/oxlint-plugin 0.11.0 → 0.12.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.
Files changed (38) hide show
  1. package/all.json +26 -2
  2. package/dist/guards.d.ts +25 -7
  3. package/dist/guards.d.ts.map +1 -1
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +1640 -288
  7. package/dist/message.d.ts +4 -2
  8. package/dist/message.d.ts.map +1 -1
  9. package/dist/rules/command-binding-matches-name.d.ts.map +1 -1
  10. package/dist/rules/command-define-pascal-const.d.ts.map +1 -1
  11. package/dist/rules/got-prefix-requires-submodel-payload.d.ts.map +1 -1
  12. package/dist/rules/got-submodel-message-name.d.ts.map +1 -1
  13. package/dist/rules/got-wrapper-carries-only-routing.d.ts.map +1 -1
  14. package/dist/rules/keyed-required-for-mapped-rows.d.ts.map +1 -1
  15. package/dist/rules/lazy-view-stable-references.d.ts.map +1 -1
  16. package/dist/rules/mount-factory-must-use-element.d.ts.map +1 -1
  17. package/dist/rules/no-array-index-view-keys.d.ts.map +1 -1
  18. package/dist/rules/no-child-message-construction-in-root.d.ts.map +1 -1
  19. package/dist/rules/no-disabling-dev-guardrails.d.ts.map +1 -1
  20. package/dist/rules/no-duplicate-onmount-per-element.d.ts.map +1 -1
  21. package/dist/rules/no-empty-children-array.d.ts.map +1 -1
  22. package/dist/rules/no-empty-commands-array.d.ts.map +1 -1
  23. package/dist/rules/no-empty-object-tagged-call.d.ts.map +1 -1
  24. package/dist/rules/no-empty-to-parent-out-message.d.ts.map +1 -1
  25. package/dist/rules/no-hardcoded-route-strings.d.ts.map +1 -1
  26. package/dist/rules/no-impure-call-at-decision-time.d.ts +7 -0
  27. package/dist/rules/no-impure-call-at-decision-time.d.ts.map +1 -0
  28. package/dist/rules/no-nonportable-server-globals.d.ts.map +1 -1
  29. package/dist/rules/no-noop-message.d.ts.map +1 -1
  30. package/dist/rules/no-raw-dom-event-attributes.d.ts.map +1 -1
  31. package/dist/rules/no-spread-in-evo.d.ts.map +1 -1
  32. package/dist/rules/prefer-effect-module-names.d.ts +3 -0
  33. package/dist/rules/prefer-effect-module-names.d.ts.map +1 -0
  34. package/dist/rules/require-rel-for-external-link.d.ts.map +1 -1
  35. package/dist/rules/selection-submodel-factory-at-module-scope.d.ts.map +1 -1
  36. package/dist/rules/wrap-child-output-in-got-message.d.ts.map +1 -1
  37. package/package.json +1 -1
  38. package/recommended.json +26 -2
package/all.json CHANGED
@@ -24,12 +24,14 @@
24
24
  "foldkit/no-empty-object-tagged-call": "error",
25
25
  "foldkit/no-hand-rolled-command-struct": "error",
26
26
  "foldkit/no-hardcoded-route-strings": "error",
27
+ "foldkit/no-impure-call-at-decision-time": "error",
27
28
  "foldkit/no-module-level-mutable-state": "error",
28
29
  "foldkit/no-nonportable-server-globals": "off",
29
30
  "foldkit/no-noop-message": "error",
30
31
  "foldkit/no-raw-dom-event-attributes": "error",
31
32
  "foldkit/no-spread-in-evo": "error",
32
33
  "foldkit/prefer-callable-message-constructor": "error",
34
+ "foldkit/prefer-effect-module-names": "error",
33
35
  "foldkit/require-rel-for-external-link": "error",
34
36
  "foldkit/selection-submodel-factory-at-module-scope": "error",
35
37
  "foldkit/wrap-child-output-in-got-message": "error"
@@ -41,7 +43,8 @@
41
43
  "**/entry.server.tsx",
42
44
  "**/server/**/*.ts",
43
45
  "**/server/**/*.tsx",
44
- "**/prerender.ts"
46
+ "**/prerender.ts",
47
+ "**/prerender.tsx"
45
48
  ],
46
49
  "excludeFiles": [
47
50
  "**/*.test.ts",
@@ -50,7 +53,27 @@
50
53
  "**/*.spec.tsx"
51
54
  ],
52
55
  "rules": {
53
- "foldkit/no-nonportable-server-globals": "error"
56
+ "foldkit/no-nonportable-server-globals": "error",
57
+ "foldkit/no-impure-call-at-decision-time": "off"
58
+ }
59
+ },
60
+ {
61
+ "files": [
62
+ "**/entry.ts",
63
+ "**/entry.tsx",
64
+ "**/entry.client.ts",
65
+ "**/entry.client.tsx",
66
+ "**/entry.server.ts",
67
+ "**/entry.server.tsx"
68
+ ],
69
+ "excludeFiles": [
70
+ "**/*.test.ts",
71
+ "**/*.test.tsx",
72
+ "**/*.spec.ts",
73
+ "**/*.spec.tsx"
74
+ ],
75
+ "rules": {
76
+ "foldkit/no-impure-call-at-decision-time": "off"
54
77
  }
55
78
  },
56
79
  {
@@ -79,6 +102,7 @@
79
102
  "foldkit/no-empty-object-tagged-call": "off",
80
103
  "foldkit/no-hand-rolled-command-struct": "off",
81
104
  "foldkit/no-hardcoded-route-strings": "off",
105
+ "foldkit/no-impure-call-at-decision-time": "off",
82
106
  "foldkit/no-module-level-mutable-state": "off",
83
107
  "foldkit/no-nonportable-server-globals": "off",
84
108
  "foldkit/no-noop-message": "off",
package/dist/guards.d.ts CHANGED
@@ -1,27 +1,45 @@
1
1
  import { Option } from 'effect';
2
- import { type ESTree } from 'effect-oxlint';
2
+ import { type ESTree, type OxlintScope, type Reference, type Variable } from 'effect-oxlint';
3
3
  export declare const isIdentifier: (node: unknown, name?: string) => node is Readonly<{
4
4
  type: 'Identifier';
5
5
  name: string;
6
6
  }>;
7
+ export declare const isIdentifierReference: (node: unknown) => node is ESTree.IdentifierReference;
7
8
  export declare const isStringLiteral: (node: unknown) => node is ESTree.StringLiteral;
8
9
  export declare const isTemplateLiteral: (node: unknown) => node is ESTree.TemplateLiteral;
9
10
  export declare const isCallExpression: (node: unknown) => node is ESTree.CallExpression;
10
- export declare const isMemberExpression: (node: unknown) => node is Readonly<{
11
- type: 'MemberExpression';
12
- object: unknown;
13
- property: unknown;
14
- computed?: boolean;
15
- }>;
11
+ export declare const isMemberExpression: (node: unknown) => node is ESTree.MemberExpression;
16
12
  export declare const isObjectExpression: (node: unknown) => node is ESTree.ObjectExpression;
13
+ export declare const isObjectProperty: (node: unknown) => node is ESTree.ObjectProperty;
17
14
  export declare const isArrayExpression: (node: unknown) => node is Readonly<{
18
15
  type: 'ArrayExpression';
19
16
  elements: ReadonlyArray<unknown>;
20
17
  }>;
21
18
  export declare const isSpreadElement: (node: unknown) => boolean;
22
19
  export declare const helperCalleeName: (callee: unknown) => Option.Option<string>;
20
+ export type StaticMemberPath = Readonly<{
21
+ root: ESTree.IdentifierReference;
22
+ members: ReadonlyArray<string>;
23
+ }>;
24
+ export declare const staticMemberPath: (node: unknown) => Option.Option<StaticMemberPath>;
23
25
  export declare const calleeMatchesHelperName: (callee: unknown, helperName: string) => boolean;
24
26
  export declare const staticStringValue: (node: unknown) => Option.Option<string>;
27
+ export declare const staticMemberName: (node: ESTree.MemberExpression) => Option.Option<string>;
28
+ export declare const staticPropertyName: (property: Readonly<{
29
+ computed?: boolean;
30
+ key: ESTree.PropertyKey;
31
+ }>) => Option.Option<string>;
32
+ export declare const indexReferences: (scopes: ReadonlyArray<OxlintScope>) => WeakMap<ESTree.Node, Reference>;
33
+ export declare const resolvedVariable: (references: WeakMap<ESTree.Node, Reference>, node: ESTree.IdentifierReference) => Option.Option<Variable>;
34
+ export type ImportedPath = Readonly<{
35
+ source: string;
36
+ members: ReadonlyArray<string>;
37
+ localMembers: ReadonlyArray<string>;
38
+ }>;
39
+ export declare const resolveImportedPath: (references: WeakMap<ESTree.Node, Reference>, node: unknown) => Option.Option<ImportedPath>;
40
+ export declare const resolveFoldkitApiPath: (references: WeakMap<ESTree.Node, Reference>, node: unknown) => Option.Option<ReadonlyArray<string>>;
41
+ export declare const isFoldkitHtmlBuilderMember: (callee: unknown, memberName: string, references: WeakMap<ESTree.Node, Reference> | undefined) => boolean;
42
+ export declare const isUnshadowedReference: (references: WeakMap<ESTree.Node, Reference> | undefined, node: ESTree.Node) => boolean;
25
43
  export declare const isVariableDeclarator: (node: unknown) => node is ESTree.VariableDeclarator;
26
44
  export declare const isVariableDeclaration: (node: unknown) => node is ESTree.VariableDeclaration;
27
45
  export declare const isProgram: (node: unknown) => node is ESTree.Program;
@@ -1 +1 @@
1
- {"version":3,"file":"guards.d.ts","sourceRoot":"","sources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B,SACxB,MAAM,CAAC,cAAc,KAC1B,MAAM,CAAC,aAAa,GAAG,SAGzB,CAAA"}
package/dist/index.d.ts CHANGED
@@ -30,12 +30,14 @@ declare const _default: {
30
30
  readonly 'no-empty-object-tagged-call': import("effect-oxlint").CreateRule;
31
31
  readonly 'no-hand-rolled-command-struct': import("effect-oxlint").CreateRule;
32
32
  readonly 'no-hardcoded-route-strings': import("effect-oxlint").CreateRule;
33
+ readonly 'no-impure-call-at-decision-time': import("effect-oxlint").CreateRule;
33
34
  readonly 'no-module-level-mutable-state': import("effect-oxlint").CreateRule;
34
35
  readonly 'no-nonportable-server-globals': import("effect-oxlint").CreateRule;
35
36
  readonly 'no-noop-message': import("effect-oxlint").CreateRule;
36
37
  readonly 'no-raw-dom-event-attributes': import("effect-oxlint").CreateRule;
37
38
  readonly 'no-spread-in-evo': import("effect-oxlint").CreateRule;
38
39
  readonly 'prefer-callable-message-constructor': import("effect-oxlint").CreateRule;
40
+ readonly 'prefer-effect-module-names': import("effect-oxlint").CreateRule;
39
41
  readonly 'require-rel-for-external-link': import("effect-oxlint").CreateRule;
40
42
  readonly 'selection-submodel-factory-at-module-scope': import("effect-oxlint").CreateRule;
41
43
  readonly 'wrap-child-output-in-got-message': import("effect-oxlint").CreateRule;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAiEtC,KAAK,QAAQ,GAAG,QAAQ,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACpB,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC5B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,CAAA;CAC3C,CAAC,CAAA;AAEF,KAAK,gBAAgB,GAAG,MAAM,CAAC,YAAY,GAAG;IAC5C,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;CAC3B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAoDG,WAAW;QACX,GAAG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAqEtC,KAAK,QAAQ,GAAG,QAAQ,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACpB,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC5B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,CAAA;CAC3C,CAAC,CAAA;AAEF,KAAK,gBAAgB,GAAG,MAAM,CAAC,YAAY,GAAG;IAC5C,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;CAC3B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAyEG,WAAW;QACX,GAAG"}