@kutur-kit/oxc 0.1.0-alpha.4 → 0.1.0-alpha.6

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 (76) hide show
  1. package/README.md +59 -7
  2. package/dist/effect.d.ts.map +1 -1
  3. package/dist/effect.js +6 -0
  4. package/dist/effect.js.map +1 -1
  5. package/dist/foldkit-stylex/attributes.d.ts +2 -0
  6. package/dist/foldkit-stylex/attributes.d.ts.map +1 -0
  7. package/dist/foldkit-stylex/attributes.js +191 -0
  8. package/dist/foldkit-stylex/attributes.js.map +1 -0
  9. package/dist/foldkit-stylex/components.d.ts +12 -0
  10. package/dist/foldkit-stylex/components.d.ts.map +1 -0
  11. package/dist/foldkit-stylex/components.js +41 -0
  12. package/dist/foldkit-stylex/components.js.map +1 -0
  13. package/dist/foldkit-stylex/condition-key.d.ts +16 -0
  14. package/dist/foldkit-stylex/condition-key.d.ts.map +1 -0
  15. package/dist/foldkit-stylex/condition-key.js +255 -0
  16. package/dist/foldkit-stylex/condition-key.js.map +1 -0
  17. package/dist/foldkit-stylex/hover-gate.d.ts +2 -0
  18. package/dist/foldkit-stylex/hover-gate.d.ts.map +1 -0
  19. package/dist/foldkit-stylex/hover-gate.js +78 -0
  20. package/dist/foldkit-stylex/hover-gate.js.map +1 -0
  21. package/dist/foldkit-stylex/styles.d.ts +2 -0
  22. package/dist/foldkit-stylex/styles.d.ts.map +1 -0
  23. package/dist/foldkit-stylex/styles.js +131 -0
  24. package/dist/foldkit-stylex/styles.js.map +1 -0
  25. package/dist/foldkit-stylex/unstyled-view.d.ts +2 -0
  26. package/dist/foldkit-stylex/unstyled-view.d.ts.map +1 -0
  27. package/dist/foldkit-stylex/unstyled-view.js +94 -0
  28. package/dist/foldkit-stylex/unstyled-view.js.map +1 -0
  29. package/dist/foldkit-stylex/vite.d.ts +2 -0
  30. package/dist/foldkit-stylex/vite.d.ts.map +1 -0
  31. package/dist/foldkit-stylex/vite.js +26 -0
  32. package/dist/foldkit-stylex/vite.js.map +1 -0
  33. package/dist/foldkit-stylex.d.ts +22 -0
  34. package/dist/foldkit-stylex.d.ts.map +1 -0
  35. package/dist/foldkit-stylex.js +26 -0
  36. package/dist/foldkit-stylex.js.map +1 -0
  37. package/dist/foldkit-stylex.json +26 -0
  38. package/dist/plugin.d.ts.map +1 -1
  39. package/dist/plugin.js +16 -0
  40. package/dist/plugin.js.map +1 -1
  41. package/dist/rules/imports.d.ts +37 -0
  42. package/dist/rules/imports.d.ts.map +1 -0
  43. package/dist/rules/imports.js +72 -0
  44. package/dist/rules/imports.js.map +1 -0
  45. package/dist/rules/no-manual-effect-runtime-in-tests.d.ts +2 -0
  46. package/dist/rules/no-manual-effect-runtime-in-tests.d.ts.map +1 -0
  47. package/dist/rules/no-manual-effect-runtime-in-tests.js +74 -0
  48. package/dist/rules/no-manual-effect-runtime-in-tests.js.map +1 -0
  49. package/dist/rules/scope.d.ts +9 -0
  50. package/dist/rules/scope.d.ts.map +1 -0
  51. package/dist/rules/scope.js +15 -0
  52. package/dist/rules/scope.js.map +1 -0
  53. package/dist/rules/self-contained-function.d.ts +2 -0
  54. package/dist/rules/self-contained-function.d.ts.map +1 -0
  55. package/dist/rules/self-contained-function.js +56 -0
  56. package/dist/rules/self-contained-function.js.map +1 -0
  57. package/dist/vendor/anti-slop/rules/no-shape-in-symbol-names.d.ts.map +1 -1
  58. package/dist/vendor/anti-slop/rules/no-shape-in-symbol-names.js +17 -1
  59. package/dist/vendor/anti-slop/rules/no-shape-in-symbol-names.js.map +1 -1
  60. package/package.json +14 -4
  61. package/src/effect.ts +6 -0
  62. package/src/foldkit-stylex/attributes.ts +282 -0
  63. package/src/foldkit-stylex/components.ts +41 -0
  64. package/src/foldkit-stylex/condition-key.ts +321 -0
  65. package/src/foldkit-stylex/hover-gate.ts +96 -0
  66. package/src/foldkit-stylex/styles.ts +170 -0
  67. package/src/foldkit-stylex/unstyled-view.ts +121 -0
  68. package/src/foldkit-stylex/vite.ts +29 -0
  69. package/src/foldkit-stylex.ts +30 -0
  70. package/src/plugin.ts +16 -0
  71. package/src/rules/imports.ts +99 -0
  72. package/src/rules/no-manual-effect-runtime-in-tests.ts +99 -0
  73. package/src/rules/scope.ts +24 -0
  74. package/src/rules/self-contained-function.ts +76 -0
  75. package/src/vendor/anti-slop/UPSTREAM.md +2 -0
  76. package/src/vendor/anti-slop/rules/no-shape-in-symbol-names.ts +22 -1
package/README.md CHANGED
@@ -1,13 +1,14 @@
1
1
  # @kutur-kit/oxc
2
2
 
3
- Oxlint and Oxfmt presets for TypeScript, with optional Effect rules.
3
+ Oxlint and Oxfmt presets for TypeScript, with optional Effect and `@kutur-kit/foldkit-stylex` rules.
4
4
 
5
- | Export | Required tools |
6
- | ------------ | ---------------------------------------------- |
7
- | `/base` | `oxlint`, a type-aware backend |
8
- | `/effect` | `oxlint`, `@effect/tsgo`, a type-aware backend |
9
- | `/format` | `oxfmt` |
10
- | `/anti-slop` | `oxlint` |
5
+ | Export | Required tools |
6
+ | ----------------- | ---------------------------------------------- |
7
+ | `/base` | `oxlint`, a type-aware backend |
8
+ | `/effect` | `oxlint`, `@effect/tsgo`, a type-aware backend |
9
+ | `/format` | `oxfmt` |
10
+ | `/anti-slop` | `oxlint` |
11
+ | `/foldkit-stylex` | `oxlint`, `@stylexjs/eslint-plugin` |
11
12
 
12
13
  The type-aware backend is [tsrs](https://github.com/oxc-project/tsrs) or `oxlint-tsgolint`.
13
14
 
@@ -37,8 +38,46 @@ Install the required tools in `devDependencies` and include linted files in your
37
38
 
38
39
  `/effect` also warns where code uses a runtime global that has an Effect service, such as `console`, `Date` or `process.env`. Its rules warn, so set `maxWarnings: 0` to fail on them. Turn a rule off with `overrides` only for files where the global is the point, such as a script that prints its result.
39
40
 
41
+ In test files (`*.test.*`, `*.spec.*`, `test/**` and `tests/**`), `/effect` also reports manual Effect runners: `Effect.runPromise`, `Effect.runSync` and the other `run*` functions, their `*With` forms and the runners of a `ManagedRuntime` made in the same file. Run effects in tests with `it.effect` from `@effect/vitest`, which provides `TestClock`, and provide services with Layers. The rule also reports runners at module scope: compute a value that a test file needs before its tests run, such as an environment flag, in `vitest.config.ts` and read it with Vitest's `provide` and `inject`.
42
+
40
43
  `/anti-slop` is optional and includes the generic and Effect rules from [anti-slop](https://github.com/dmmulroy/anti-slop), and `kit/comment-prose` (see [Prose](#prose)).
41
44
 
45
+ ### @kutur-kit/foldkit-stylex
46
+
47
+ `/foldkit-stylex` checks what the types of `@kutur-kit/foldkit-stylex` cannot see:
48
+
49
+ - a second Class on an element, or a Class or Style that replaces a @foldkit/ui part's, on a bundle `toView` hands out or `DragAndDropStyle.draggable` returns, or in a `*Attributes` view input;
50
+ - a @foldkit/ui view used unstyled, in place of the theme's namespace, such as `Listbox` from `@kutur-kit/foldkit-stylex-theme/listbox`, or a view wrapped with `XStyle.view` for a look of your own;
51
+ - StyleX condition keys that never match or that rank differently than written, such as `:focus-visible` or `:has(:focus-visible)` next to `:hover` or `:user-invalid`;
52
+ - `:hover` styles outside `@media (hover: hover)`, which touch browsers keep after a tap;
53
+ - `createTheme`, `--fks-*` tokens set on an element, theme overrides without `satisfies ThemeOverrides`, styles objects annotated or cast with `as`, and arrays of them annotated, cast or typed as a parameter;
54
+ - StyleX's own Vite plugin.
55
+
56
+ It also turns on StyleX's ESLint rules. Each message names the fix. Add `@stylexjs/eslint-plugin` to your `devDependencies` beside Oxlint, then extend the preset in `oxlint.config.ts`:
57
+
58
+ ```ts
59
+ import effect from "@kutur-kit/oxc/effect";
60
+ import foldkitStylex from "@kutur-kit/oxc/foldkit-stylex";
61
+ import { defineConfig } from "oxlint";
62
+
63
+ export default defineConfig({
64
+ extends: [effect, foldkitStylex],
65
+ options: { typeAware: true, maxWarnings: 0 },
66
+ });
67
+ ```
68
+
69
+ Or in `.oxlintrc.json`, which extends configs by path:
70
+
71
+ ```json
72
+ {
73
+ "extends": ["./node_modules/@kutur-kit/oxc/dist/foldkit-stylex.json"]
74
+ }
75
+ ```
76
+
77
+ The rules recognise `sx`, the `XStyle` namespaces, StyleX, Effect and @foldkit/ui by their imports, named, aliased or as a namespace, and read each file on its own. They recognise @foldkit/ui parts by the names `toView`, `entryToView`, `toCalendarView` and `*Attributes`, so an app's own Submodel that uses those names is checked as a @foldkit/ui part. They follow bundles through `map`, `flatMap` and `filter` written in place, as array methods, Effect `Array` functions or `pipe` steps.
78
+
79
+ They miss a @foldkit/ui view, a `create()` result or a styled draggable that reaches the file through another module, a bundle kept in a variable or iterated another way, a Class that a helper adds to a bundle passed to it, and a `*Attributes` input whose `childAttributes([...])` call is not written in place.
80
+
42
81
  ### Suppression comments
43
82
 
44
83
  `kit/no-suppression-directives` reports comments that suppress Oxlint rules or Effect diagnostics, reading `oxlint-disable`, `eslint-disable` and `@effect-diagnostics` as Oxlint and tsgo read them. With `{ allowWithReason: true }`, as `/base` sets it, a comment passes when it names each rule and gives a reason after `--`:
@@ -54,6 +93,19 @@ A comment that disables `kit/no-suppression-directives` itself turns the rule of
54
93
 
55
94
  tsgo also reads `@effect-diagnostics` in string literals, which the rule does not check.
56
95
 
96
+ ### Functions sent to a page
97
+
98
+ `kit/self-contained-function` reports an exported function that reads a binding of its own module other than a type, such as a helper, a constant or an import. Playwright's `page.evaluate` and `page.addInitScript` send a function to the page as source, where those bindings do not exist. No preset turns it on. With `/base` or `/effect`, enable it for the modules that export such functions:
99
+
100
+ ```ts
101
+ export default defineConfig({
102
+ extends: [effect],
103
+ overrides: [{ files: ["src/testing.ts"], rules: { "kit/self-contained-function": "error" } }],
104
+ });
105
+ ```
106
+
107
+ It checks functions exported where they are declared, not ones exported later with `export { name }`, and reads each module on its own.
108
+
57
109
  ## Prose
58
110
 
59
111
  `kit/comment-prose`, which `/anti-slop` turns on, checks comments. The `kit-prose` command checks Markdown. Both report vague words such as `lands`, `gated` or `leverage`, and dashes used as punctuation: an em dash anywhere, or an en dash, `-` or `--` with a space on each side. Each message names the fix. Put a literal use, such as an identifier, in a code span.
@@ -1 +1 @@
1
- {"version":3,"file":"effect.d.ts","sources":["../src/effect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAM3C,QAAA,MAAM,MAAM,EAAE,YAsBb,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"effect.d.ts","sources":["../src/effect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAM3C,QAAA,MAAM,MAAM,EAAE,YA4Bb,CAAC;AAEF,eAAe,MAAM,CAAC"}
package/dist/effect.js CHANGED
@@ -21,6 +21,12 @@ const effect = {
21
21
  // Effect's documented form for a service is a class that extends `Context.Service`.
22
22
  "effecttsgo/service-not-as-class": "warn",
23
23
  },
24
+ overrides: [
25
+ {
26
+ files: ["**/*.test.*", "**/*.spec.*", "**/test/**", "**/tests/**"],
27
+ rules: { "kit/no-manual-effect-runtime-in-tests": "error" },
28
+ },
29
+ ],
24
30
  options: { typeAware: true },
25
31
  };
26
32
  export default effect;
@@ -1 +1 @@
1
- {"version":3,"file":"effect.js","sources":["../src/effect.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,MAAM,GAAiB;IAC3B,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC;IAC5B,KAAK,EAAE;QACL,kFAAkF;QAClF,+BAA+B,EAAE,MAAM;QACvC,yCAAyC,EAAE,MAAM;QACjD,2BAA2B,EAAE,MAAM;QACnC,qCAAqC,EAAE,MAAM;QAC7C,wBAAwB,EAAE,MAAM;QAChC,kCAAkC,EAAE,MAAM;QAC1C,yBAAyB,EAAE,MAAM;QACjC,mCAAmC,EAAE,MAAM;QAC3C,0BAA0B,EAAE,MAAM;QAClC,oCAAoC,EAAE,MAAM;QAC5C,0BAA0B,EAAE,MAAM;QAClC,oCAAoC,EAAE,MAAM;QAC5C,wBAAwB,EAAE,MAAM;QAChC,kCAAkC,EAAE,MAAM;QAC1C,oFAAoF;QACpF,iCAAiC,EAAE,MAAM;KAC1C;IACD,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;CAC7B,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"effect.js","sources":["../src/effect.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,MAAM,GAAiB;IAC3B,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC;IAC5B,KAAK,EAAE;QACL,kFAAkF;QAClF,+BAA+B,EAAE,MAAM;QACvC,yCAAyC,EAAE,MAAM;QACjD,2BAA2B,EAAE,MAAM;QACnC,qCAAqC,EAAE,MAAM;QAC7C,wBAAwB,EAAE,MAAM;QAChC,kCAAkC,EAAE,MAAM;QAC1C,yBAAyB,EAAE,MAAM;QACjC,mCAAmC,EAAE,MAAM;QAC3C,0BAA0B,EAAE,MAAM;QAClC,oCAAoC,EAAE,MAAM;QAC5C,0BAA0B,EAAE,MAAM;QAClC,oCAAoC,EAAE,MAAM;QAC5C,wBAAwB,EAAE,MAAM;QAChC,kCAAkC,EAAE,MAAM;QAC1C,oFAAoF;QACpF,iCAAiC,EAAE,MAAM;KAC1C;IACD,SAAS,EAAE;QACT;YACE,KAAK,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,CAAC;YAClE,KAAK,EAAE,EAAE,uCAAuC,EAAE,OAAO,EAAE;SAC5D;KACF;IACD,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE;CAC7B,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const attributes: import("@oxlint/plugins").Rule;
2
+ //# sourceMappingURL=attributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributes.d.ts","sources":["../../src/foldkit-stylex/attributes.ts"],"names":[],"mappings":"AA2DA,eAAO,MAAM,UAAU,gCA8NrB,CAAC"}
@@ -0,0 +1,191 @@
1
+ import { defineRule } from "@oxlint/plugins";
2
+ import { effectMemberOf, exportOf, importsOf, isMethodCall, keyOf, resolve, rootOf, } from "../rules/imports.js";
3
+ import { variableOf } from "../rules/scope.js";
4
+ const kit = "@kutur-kit/foldkit-stylex";
5
+ // Callbacks through which @foldkit/ui hands the app attribute bundles for its parts.
6
+ const bundleCallbacks = new Set(["toView", "entryToView", "toCalendarView"]);
7
+ // View inputs whose attributes @foldkit/ui applies to a part after the part's class, such as
8
+ // `buttonAttributes`.
9
+ const attributesInput = /^(attributes|\w+Attributes)$/;
10
+ // Array methods and Effect Array functions that call a callback with each item of an array.
11
+ const iterators = new Set(["map", "flatMap"]);
12
+ // Array methods and Effect Array functions that return some items of an array.
13
+ const filters = new Set(["filter"]);
14
+ // The value of a `toView`-like property, as in `toView: (attributes) => ...` or `toView: view`.
15
+ const isBundleCallback = (node) => node.parent?.type === "Property" &&
16
+ node.parent.value === node &&
17
+ bundleCallbacks.has(keyOf(node.parent) ?? "");
18
+ const isSx = (node, imports) => node.type === "CallExpression" && exportOf(node.callee, imports, kit) === "sx";
19
+ // Whether `node` writes an element's class or its style, of which Foldkit keeps one each, and
20
+ // whether it writes it raw, as `h.Attribute("class", ...)`.
21
+ const writtenBy = (node, imports) => {
22
+ if (isMethodCall(node, "Attribute")) {
23
+ const [name] = node.arguments;
24
+ return name?.type === "Literal" && (name.value === "class" || name.value === "style")
25
+ ? { attribute: name.value, raw: true }
26
+ : undefined;
27
+ }
28
+ if (isSx(node, imports) || isMethodCall(node, "Class"))
29
+ return { attribute: "class", raw: false };
30
+ return isMethodCall(node, "Style") ? { attribute: "style", raw: false } : undefined;
31
+ };
32
+ export const attributes = defineRule({
33
+ meta: {
34
+ type: "problem",
35
+ docs: {
36
+ description: "Keep one Class per element: styles in one sx(...) call, after every spread, and never on a @foldkit/ui part.",
37
+ },
38
+ schema: [],
39
+ messages: {
40
+ partClass: "This element is a @foldkit/ui part, whose Class its XStyle wrapper sets. Put these styles in that part's entry of its styles: Foldkit keeps one Class per element, so this replaces the part's styles and the functional ones.",
41
+ partStyle: "This element is a @foldkit/ui part, whose inline style @foldkit/ui owns, and Foldkit keeps one Style per element, so this replaces it. Put static styles in that part's entry of its styles. For a runtime value, set a custom property with h.Style on your own element around the part and read it with var() in the part's styles; a portaled panel inherits from none of your elements, so set it on an element you render inside the panel and style that element.",
42
+ oneCall: "Pass every style of this element to one sx(...) call, conditions included. Foldkit keeps one Class per element, and StyleX resolves conflicting properties only within one call.",
43
+ oneClass: "Join these class names into one Class. Foldkit keeps one Class per element, so this one replaces the ones before it.",
44
+ last: "Put sx(...) last in the attribute list. Foldkit keeps the last Class, so a bundle spread after it replaces these styles.",
45
+ rawClass: "Use sx(...) for StyleX styles or h.Class(...) for class names. Scene's toHaveClass cannot see a raw class attribute.",
46
+ rawStyle: "Use h.Style(...). A raw style attribute throws when the element also gets a Style, as @foldkit/ui panels do.",
47
+ stylexRuntime: "Use sx(...). stylex.props returns numbers that h.Style rejects and omits className when no style applies; stylex.attrs kebab-cases custom properties and returns a raw attribute Scene cannot see.",
48
+ notInElement: "Write sx(...) directly in the attribute list of the element it styles, so this rule sees every Class that element gets. Put conditions inside the call: sx(isOpen ? styles.open : styles.closed).",
49
+ },
50
+ },
51
+ createOnce(context) {
52
+ let imports = new Map();
53
+ // A binding made by `DragAndDropStyle.draggable(...)`, which returns the draggable's attributes
54
+ // with its Class.
55
+ const isStyledDraggable = (callee) => callee.type === "Identifier" &&
56
+ (variableOf(context.sourceCode, callee)?.defs.some(({ node }) => node.type === "VariableDeclarator" &&
57
+ node.init?.type === "CallExpression" &&
58
+ exportOf(node.init.callee, imports, kit) === "DragAndDropStyle.draggable") ??
59
+ false);
60
+ // The Effect Array function `callee` names, such as `map` for `Array.map`.
61
+ const arrayFunctionOf = (callee) => effectMemberOf(resolve(callee, imports), "Array");
62
+ // Effect's `pipe`, from effect or effect/Function.
63
+ const isPipe = (callee) => {
64
+ const imported = resolve(callee, imports);
65
+ return ((imported?.source === "effect" && imported.path === "pipe") ||
66
+ effectMemberOf(imported, "Function") === "pipe");
67
+ };
68
+ // The array a call of one of `names` reads: the receiver of `tabs.map(...)`, or the first
69
+ // argument of Effect's `Array.map(tabs, ...)`.
70
+ const arrayOf = (call, names) => {
71
+ const { callee } = call;
72
+ const effect = arrayFunctionOf(callee);
73
+ if (effect !== undefined)
74
+ return names.has(effect) ? call.arguments[0] : undefined;
75
+ return callee.type === "MemberExpression" &&
76
+ !callee.computed &&
77
+ callee.property.type === "Identifier" &&
78
+ names.has(callee.property.name)
79
+ ? callee.object
80
+ : undefined;
81
+ };
82
+ // A part's bundle: a parameter of a function @foldkit/ui calls with bundles, a member of one
83
+ // such as `tab.tab`, bundles filtered as in `tabs.filter(...)` or `Array.filter(tabs, ...)`, or
84
+ // the result of a styled draggable.
85
+ const isBundle = (node) => {
86
+ if (node === undefined || node.type === "SpreadElement")
87
+ return false;
88
+ if (node.type === "CallExpression") {
89
+ return isBundle(arrayOf(node, filters)) || isStyledDraggable(node.callee);
90
+ }
91
+ const root = rootOf(node);
92
+ const variable = root === undefined ? undefined : variableOf(context.sourceCode, root);
93
+ return (variable?.defs.some((def) => def.type === "Parameter" && takesBundles(def.node)) ?? false);
94
+ };
95
+ // The `const` or `function` declaration that names `fn`.
96
+ const declarationOf = (fn) => {
97
+ if (fn.type === "FunctionDeclaration")
98
+ return fn;
99
+ return fn.parent?.type === "VariableDeclarator" && fn.parent.init === fn
100
+ ? fn.parent
101
+ : undefined;
102
+ };
103
+ // A function @foldkit/ui calls with bundles: one written as a `toView`-like property, one
104
+ // declared by name and passed as one, as in `toView: checkboxView`, or a callback that iterates
105
+ // bundles, as in `tabs.map(cb)`, `Array.map(tabs, cb)` or `pipe(tabs, Array.map(cb))`.
106
+ const takesBundles = (fn) => {
107
+ if (isBundleCallback(fn))
108
+ return true;
109
+ const declaration = declarationOf(fn);
110
+ if (declaration !== undefined) {
111
+ return context.sourceCode
112
+ .getDeclaredVariables(declaration)
113
+ .some(({ defs, references }) => defs.some(({ type }) => type !== "Parameter") &&
114
+ references.some(({ identifier }) => isBundleCallback(identifier)));
115
+ }
116
+ const { parent } = fn;
117
+ if (parent?.type !== "CallExpression")
118
+ return false;
119
+ const pipeline = parent.parent;
120
+ // A data-last step of a pipe gets what flows from the pipe's first argument.
121
+ if (pipeline.type === "CallExpression" &&
122
+ isPipe(pipeline.callee) &&
123
+ parent.arguments.length === 1 &&
124
+ iterators.has(arrayFunctionOf(parent.callee) ?? "")) {
125
+ return isBundle(pipeline.arguments[0]);
126
+ }
127
+ return isBundle(arrayOf(parent, iterators));
128
+ };
129
+ // An attribute list that ends up on a part: one that spreads a part's bundle, or the
130
+ // `childAttributes([...])` of a view input such as `buttonAttributes`.
131
+ const isPartList = (list) => {
132
+ const { parent } = list;
133
+ if (parent.type === "CallExpression" &&
134
+ exportOf(parent.callee, imports, "foldkit/html") === "childAttributes") {
135
+ return (parent.parent.type === "Property" && attributesInput.test(keyOf(parent.parent) ?? ""));
136
+ }
137
+ return list.elements.some((item) => item?.type === "SpreadElement" && isBundle(item.argument));
138
+ };
139
+ return {
140
+ Program(program) {
141
+ imports = importsOf(program);
142
+ },
143
+ CallExpression(node) {
144
+ const runtime = exportOf(node.callee, imports, "@stylexjs/stylex");
145
+ // A result the code throws away, as in a compile guard, reaches no element.
146
+ if ((runtime === "props" || runtime === "attrs") &&
147
+ node.parent.type !== "ExpressionStatement") {
148
+ context.report({ node, messageId: "stylexRuntime" });
149
+ }
150
+ if (isSx(node, imports) && node.parent.type !== "ArrayExpression") {
151
+ context.report({ node, messageId: "notInElement" });
152
+ }
153
+ },
154
+ ArrayExpression(node) {
155
+ const written = node.elements.flatMap((item) => {
156
+ if (item === null)
157
+ return [];
158
+ const writes = writtenBy(item, imports);
159
+ return writes === undefined ? [] : [{ item, ...writes }];
160
+ });
161
+ if (isPartList(node)) {
162
+ for (const { item, attribute } of written) {
163
+ context.report({
164
+ node: item,
165
+ messageId: attribute === "class" ? "partClass" : "partStyle",
166
+ });
167
+ }
168
+ return;
169
+ }
170
+ for (const { item, attribute } of written.filter(({ raw }) => raw)) {
171
+ context.report({
172
+ node: item,
173
+ messageId: attribute === "class" ? "rawClass" : "rawStyle",
174
+ });
175
+ }
176
+ const classWriters = written.flatMap(({ item, attribute, raw }) => attribute === "class" && !raw ? [item] : []);
177
+ const oneCall = classWriters.some((item) => isSx(item, imports)) ? "oneCall" : "oneClass";
178
+ for (const item of classWriters.slice(1)) {
179
+ context.report({ node: item, messageId: oneCall });
180
+ }
181
+ const items = node.elements.filter((item) => item !== null);
182
+ const lastSpread = items.map((item) => item.type).lastIndexOf("SpreadElement");
183
+ for (const item of items.slice(0, Math.max(lastSpread, 0))) {
184
+ if (isSx(item, imports))
185
+ context.report({ node: item, messageId: "last" });
186
+ }
187
+ },
188
+ };
189
+ },
190
+ });
191
+ //# sourceMappingURL=attributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attributes.js","sources":["../../src/foldkit-stylex/attributes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EACL,cAAc,EACd,QAAQ,EAER,SAAS,EACT,YAAY,EACZ,KAAK,EACL,OAAO,EACP,MAAM,GACP,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,GAAG,GAAG,2BAA2B,CAAC;AAExC,qFAAqF;AACrF,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,aAAa,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAE7E,6FAA6F;AAC7F,sBAAsB;AACtB,MAAM,eAAe,GAAG,8BAA8B,CAAC;AAEvD,4FAA4F;AAC5F,MAAM,SAAS,GAAG,IAAI,GA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EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;gBACrD,CAAC;gBAED,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;gBAE5D,MAAM,UAAU,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;gBAE/E,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC3D,IAAI,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC;wBAAE,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;gBAC7E,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The @foldkit/ui namespaces that @kutur-kit/foldkit-stylex wraps, as `<Name>Style` namespaces.
3
+ * `foldkit-stylex-unstyled-view` asks for a wrapper only for these. A test compares the list with
4
+ * the core's `src/index.ts`, so add a name in the change that adds its namespace to the core.
5
+ */
6
+ export declare const components: ReadonlySet<string>;
7
+ /**
8
+ * The view each `<Name>Style` namespace wraps under the same name. DragAndDrop has no `view`: its
9
+ * styled part is the bundle `draggable` returns.
10
+ */
11
+ export declare const viewOf: (component: string) => "draggable" | "view";
12
+ //# sourceMappingURL=components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.ts","sources":["../../src/foldkit-stylex/components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,WAAW,CAAC,MAAM,CA6BzC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,MAAM,cAAe,MAAM,yBAAyD,CAAC"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * The @foldkit/ui namespaces that @kutur-kit/foldkit-stylex wraps, as `<Name>Style` namespaces.
3
+ * `foldkit-stylex-unstyled-view` asks for a wrapper only for these. A test compares the list with
4
+ * the core's `src/index.ts`, so add a name in the change that adds its namespace to the core.
5
+ */
6
+ export const components = new Set([
7
+ "Animation",
8
+ "Button",
9
+ "Calendar",
10
+ "Checkbox",
11
+ "Combobox",
12
+ "DatePicker",
13
+ "Dialog",
14
+ "Disclosure",
15
+ "DragAndDrop",
16
+ "Fieldset",
17
+ "FileDrop",
18
+ "HoverIntent",
19
+ "Input",
20
+ "Listbox",
21
+ "Menu",
22
+ "Meter",
23
+ "Nav",
24
+ "Popover",
25
+ "Progress",
26
+ "RadioGroup",
27
+ "Select",
28
+ "Slider",
29
+ "Switch",
30
+ "Tabs",
31
+ "Textarea",
32
+ "Toast",
33
+ "Tooltip",
34
+ "VirtualList",
35
+ ]);
36
+ /**
37
+ * The view each `<Name>Style` namespace wraps under the same name. DragAndDrop has no `view`: its
38
+ * styled part is the bundle `draggable` returns.
39
+ */
40
+ export const viewOf = (component) => (component === "DragAndDrop" ? "draggable" : "view");
41
+ //# sourceMappingURL=components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.js","sources":["../../src/foldkit-stylex/components.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAwB,IAAI,GAAG,CAAC;IACrD,WAAW;IACX,QAAQ;IACR,UAAU;IACV,UAAU;IACV,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,YAAY;IACZ,aAAa;IACb,UAAU;IACV,UAAU;IACV,aAAa;IACb,OAAO;IACP,SAAS;IACT,MAAM;IACN,OAAO;IACP,KAAK;IACL,SAAS;IACT,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,UAAU;IACV,OAAO;IACP,SAAS;IACT,aAAa;CACd,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,CAAC,SAAS,KAAK,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ type Bound = Readonly<{
2
+ value: number;
3
+ inclusive: boolean;
4
+ }>;
5
+ type WidthRange = Readonly<{
6
+ min: Bound;
7
+ max: Bound;
8
+ }>;
9
+ type MediaQuery = Readonly<{
10
+ range: WidthRange;
11
+ features: ReadonlySet<string>;
12
+ }>;
13
+ export declare const mediaQueryOf: (key: string) => MediaQuery | undefined;
14
+ export declare const conditionKey: import("@oxlint/plugins").Rule;
15
+ export {};
16
+ //# sourceMappingURL=condition-key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"condition-key.d.ts","sources":["../../src/foldkit-stylex/condition-key.ts"],"names":[],"mappings":"AAeA,KAAK,KAAK,GAAG,QAAQ,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAG7D,KAAK,UAAU,GAAG,QAAQ,CAAC;IAAE,GAAG,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAIvD,KAAK,UAAU,GAAG,QAAQ,CAAC;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC,CAAC;AAwBjF,eAAO,MAAM,YAAY,QAAS,MAAM,KAAG,UAAU,GAAG,SAoCvD,CAAC;AAoFF,eAAO,MAAM,YAAY,gCA0JvB,CAAC"}