@heyramzi/lint 2.4.0 → 2.4.2

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/jev.js CHANGED
@@ -14,8 +14,8 @@ import { join } from "node:path";
14
14
  // =========================
15
15
  /** One request that hangs must not hang a draft: past this it counts as unreachable. */
16
16
  const TIMEOUT_MS = 30_000;
17
- /** Pinned to the version the thresholds were benched on; the gateway also serves `typesafe-ai/jev` (latest). */
18
- export const MODEL = "typesafe-ai/jev-1.13.0";
17
+ /** The gateway's moving latest, never a version, so each Jev release reaches the gate (TECHLOG.md). */
18
+ export const MODEL = "typesafe-ai/jev";
19
19
  export const JEV_OFF =
20
20
  "Jev is off: set JEV_BASE_URL and JEV_API_KEY (env, or Proton Pass, Dev vault, item AI endpoints)";
21
21
  export const FAIL = 0.75;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heyramzi/lint",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "description": "Shared oxlint rules, base config and gates for Studio projects",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -3,11 +3,23 @@
3
3
  */
4
4
 
5
5
  /*
6
- * A union or a conditional type can't be an interface, so those stay allowed. The fix rewrites an object-literal alias, the common case.
6
+ * A union or a conditional type can't be an interface, even nested in a generic like `WithElementRef<A & (B | C)>`, so those stay allowed.
7
7
  */
8
8
 
9
9
  const NOT_AN_INTERFACE = new Set(["TSUnionType", "TSConditionalType", "TSMappedType"]);
10
10
 
11
+ function holdsNonInterface(node) {
12
+ if (!node || typeof node.type !== "string") return false;
13
+ if (NOT_AN_INTERFACE.has(node.type)) return true;
14
+ // An object literal's members can hold unions freely; only the alias's own shape matters.
15
+ if (node.type === "TSTypeLiteral") return false;
16
+ return Object.entries(node).some(
17
+ ([key, child]) =>
18
+ key !== "parent" &&
19
+ (Array.isArray(child) ? child.some(holdsNonInterface) : holdsNonInterface(child)),
20
+ );
21
+ }
22
+
11
23
  export default {
12
24
  meta: {
13
25
  type: "suggestion",
@@ -24,7 +36,7 @@ export default {
24
36
  return {
25
37
  TSTypeAliasDeclaration(node) {
26
38
  if (node.id.name !== "Props") return;
27
- if (NOT_AN_INTERFACE.has(node.typeAnnotation.type)) return;
39
+ if (holdsNonInterface(node.typeAnnotation)) return;
28
40
  const fixable =
29
41
  node.typeAnnotation.type === "TSTypeLiteral" && !node.typeParameters && !node.declare;
30
42
  context.report({