@webpieces/code-rules 0.4.926 → 0.4.928

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 (104) hide show
  1. package/package.json +6 -6
  2. package/src/api-lib-source-rule.d.ts +1 -1
  3. package/src/api-lib-source-rule.js +1 -3
  4. package/src/api-lib-source-rule.js.map +1 -1
  5. package/src/code-policy-composition.js +10 -1
  6. package/src/code-policy-composition.js.map +1 -1
  7. package/src/code-rules-bootstrap.js +1 -1
  8. package/src/code-rules-bootstrap.js.map +1 -1
  9. package/src/code-rules-engine.d.ts +3 -1
  10. package/src/code-rules-engine.js +13 -4
  11. package/src/code-rules-engine.js.map +1 -1
  12. package/src/configs/api-lib-spelling-configs.d.ts +2 -4
  13. package/src/configs/api-lib-spelling-configs.js +2 -8
  14. package/src/configs/api-lib-spelling-configs.js.map +1 -1
  15. package/src/configs/no-client-creation-config.d.ts +0 -1
  16. package/src/configs/no-client-creation-config.js +1 -4
  17. package/src/configs/no-client-creation-config.js.map +1 -1
  18. package/src/configs/no-state-paths-config.js +0 -1
  19. package/src/configs/no-state-paths-config.js.map +1 -1
  20. package/src/configs/no-utility-types-config.d.ts +1 -2
  21. package/src/configs/no-utility-types-config.js +1 -4
  22. package/src/configs/no-utility-types-config.js.map +1 -1
  23. package/src/configs/required-type-suffix-config.d.ts +1 -2
  24. package/src/configs/required-type-suffix-config.js +1 -4
  25. package/src/configs/required-type-suffix-config.js.map +1 -1
  26. package/src/configs/rule-configs.d.ts +0 -5
  27. package/src/configs/rule-configs.js +13 -44
  28. package/src/configs/rule-configs.js.map +1 -1
  29. package/src/configs/tag-truth-configs.d.ts +4 -2
  30. package/src/configs/tag-truth-configs.js +4 -4
  31. package/src/configs/tag-truth-configs.js.map +1 -1
  32. package/src/index.d.ts +1 -0
  33. package/src/index.js +7 -2
  34. package/src/index.js.map +1 -1
  35. package/src/rule-dispatch.d.ts +30 -0
  36. package/src/rule-dispatch.js +49 -0
  37. package/src/rule-dispatch.js.map +1 -0
  38. package/src/rule-migrations.d.ts +17 -0
  39. package/src/rule-migrations.js +40 -0
  40. package/src/rule-migrations.js.map +1 -0
  41. package/src/rule-pack.js +2 -1
  42. package/src/rule-pack.js.map +1 -1
  43. package/src/scan-scope.js +4 -1
  44. package/src/scan-scope.js.map +1 -1
  45. package/src/tag-rule.js +1 -14
  46. package/src/tag-rule.js.map +1 -1
  47. package/src/validate-catch-error-pattern.js +1 -17
  48. package/src/validate-catch-error-pattern.js.map +1 -1
  49. package/src/validate-dtos.js +1 -18
  50. package/src/validate-dtos.js.map +1 -1
  51. package/src/validate-ensure-we-are-secure.js +3 -0
  52. package/src/validate-ensure-we-are-secure.js.map +1 -1
  53. package/src/validate-framework-packages.js +3 -1
  54. package/src/validate-framework-packages.js.map +1 -1
  55. package/src/validate-inject-annotation-not-needed-for-concrete-class.d.ts +1 -1
  56. package/src/validate-inject-annotation-not-needed-for-concrete-class.js +10 -25
  57. package/src/validate-inject-annotation-not-needed-for-concrete-class.js.map +1 -1
  58. package/src/validate-match-rules.d.ts +0 -1
  59. package/src/validate-match-rules.js +1 -12
  60. package/src/validate-match-rules.js.map +1 -1
  61. package/src/validate-modified-files.d.ts +0 -7
  62. package/src/validate-modified-files.js +8 -22
  63. package/src/validate-modified-files.js.map +1 -1
  64. package/src/validate-modified-methods.js +2 -6
  65. package/src/validate-modified-methods.js.map +1 -1
  66. package/src/validate-new-methods.js +2 -6
  67. package/src/validate-new-methods.js.map +1 -1
  68. package/src/validate-no-any-unknown.js +1 -18
  69. package/src/validate-no-any-unknown.js.map +1 -1
  70. package/src/validate-no-client-creation-outside-server-or-client.d.ts +2 -3
  71. package/src/validate-no-client-creation-outside-server-or-client.js +4 -18
  72. package/src/validate-no-client-creation-outside-server-or-client.js.map +1 -1
  73. package/src/validate-no-custom-css.d.ts +0 -1
  74. package/src/validate-no-custom-css.js +1 -12
  75. package/src/validate-no-custom-css.js.map +1 -1
  76. package/src/validate-no-destructure.d.ts +3 -3
  77. package/src/validate-no-destructure.js +11 -31
  78. package/src/validate-no-destructure.js.map +1 -1
  79. package/src/validate-no-direct-api-resolver.js +1 -18
  80. package/src/validate-no-direct-api-resolver.js.map +1 -1
  81. package/src/validate-no-function-outside-class.d.ts +3 -3
  82. package/src/validate-no-function-outside-class.js +11 -25
  83. package/src/validate-no-function-outside-class.js.map +1 -1
  84. package/src/validate-no-implicit-any.js +1 -14
  85. package/src/validate-no-implicit-any.js.map +1 -1
  86. package/src/validate-no-inline-types.js +1 -18
  87. package/src/validate-no-inline-types.js.map +1 -1
  88. package/src/validate-no-process-exit-outside-main.js +1 -12
  89. package/src/validate-no-process-exit-outside-main.js.map +1 -1
  90. package/src/validate-no-state-paths-in-templates.d.ts +0 -1
  91. package/src/validate-no-state-paths-in-templates.js +1 -12
  92. package/src/validate-no-state-paths-in-templates.js.map +1 -1
  93. package/src/validate-no-symbol-di-tokens.d.ts +2 -2
  94. package/src/validate-no-symbol-di-tokens.js +9 -65
  95. package/src/validate-no-symbol-di-tokens.js.map +1 -1
  96. package/src/validate-no-unmanaged-exceptions.js +1 -17
  97. package/src/validate-no-unmanaged-exceptions.js.map +1 -1
  98. package/src/validate-prisma-converters.js +1 -18
  99. package/src/validate-prisma-converters.js.map +1 -1
  100. package/src/validate-return-types.js +1 -18
  101. package/src/validate-return-types.js.map +1 -1
  102. package/src/resolve-mode.d.ts +0 -2
  103. package/src/resolve-mode.js +0 -11
  104. package/src/resolve-mode.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"no-utility-types-config.js","sourceRoot":"","sources":["../../../../../../packages/tooling/code-rules/src/configs/no-utility-types-config.ts"],"names":[],"mappings":";;;AAAA,oDAA+F;AAC/F,oDAA6E;AAC7E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,4BAA6B,SAAQ,0BAAc;IAE5D,KAAK,CAAY;IACjB,YAAY,CAAY;IAExB,MAAM,CAAU,MAAM,GAA8C;QAChE,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,+BAAmB,CAAC;QACjD,KAAK,EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;QAC/B,YAAY,EAAE,oBAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC3C,GAAG,4BAAgB;KACtB,CAAC;;AAVN,oEAWC","sourcesContent":["import { FieldDef, SchemaShape, BaseRuleConfig, BASE_RULE_SCHEMA } from \"@webpieces/rules-sdk\";\nimport { ModifiedCodeMode, MODIFIED_CODE_MODES } from \"@webpieces/rules-sdk\";\n/**\n * `no-utility-types-in-api-lib` (#1026) — in every `.ts` file under `paths`, refuse the TypeScript\n * utility types that turn a contract's field list (or its set of keys) into a type-level computation:\n * `Omit`, `Pick`, `Partial`, `Required`, `Exclude` and `Extract`. Refused wherever a type is written\n * — `interface X extends Omit<…>`, a field type, a type alias, a generic argument.\n *\n * Why the whole family and not `Omit` alone: every one of them makes a reader open a second file and\n * compute the fields (or keys) in their head, none of them can become a DTO class (`class X extends\n * Omit<…>` does not compile — a utility type has no runtime value), and banning `Omit` alone just\n * moves the same computation into `Pick<T, Exclude<keyof T, K>>`. `Record`, `Readonly`, `Array` and\n * friends stay allowed: they do not hide which fields a DTO carries.\n *\n * Every field that decides behaviour is REQUIRED with no default (`.claude/rules/no-rule-defaults.md`):\n * - `mode` — OFF | NEW_AND_MODIFIED_CODE (only changed lines, so existing code is fixed as it is\n * touched) | NEW_AND_MODIFIED_FILES (every occurrence in a changed file) | MODIFIED_PROJECTS /\n * RUN_EVERY_TIME (every occurrence in a touched project / in the repo — #1027).\n * - `paths` — the globs of the API contract libraries this rule judges, e.g. `[\"libraries/apis/**\"]`.\n * An empty list judges nothing.\n *\n * `allowedPaths` exempts whole trees inside `paths`. The per-site escape hatch is\n * `// webpieces-disable no-utility-types-in-api-lib -- <reason>` on the line or the line above.\n */\nexport class NoUtilityTypesInApiLibConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n paths!: string[];\n allowedPaths?: string[];\n\n static readonly SCHEMA: SchemaShape<NoUtilityTypesInApiLibConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n paths: new FieldDef('string[]'),\n allowedPaths: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n"]}
1
+ {"version":3,"file":"no-utility-types-config.js","sourceRoot":"","sources":["../../../../../../packages/tooling/code-rules/src/configs/no-utility-types-config.ts"],"names":[],"mappings":";;;AAAA,oDAA6E;AAC7E,oDAA6E;AAC7E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,4BAA6B,SAAQ,0BAAc;IAE5D,KAAK,CAAY;IAEjB,MAAM,CAAU,MAAM,GAA8C;QAChE,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,+BAAmB,CAAC;QACjD,KAAK,EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;KAClC,CAAC;;AAPN,oEAQC","sourcesContent":["import { FieldDef, SchemaShape, BaseRuleConfig } from \"@webpieces/rules-sdk\";\nimport { ModifiedCodeMode, MODIFIED_CODE_MODES } from \"@webpieces/rules-sdk\";\n/**\n * `no-utility-types-in-api-lib` (#1026) — in every `.ts` file under `paths`, refuse the TypeScript\n * utility types that turn a contract's field list (or its set of keys) into a type-level computation:\n * `Omit`, `Pick`, `Partial`, `Required`, `Exclude` and `Extract`. Refused wherever a type is written\n * — `interface X extends Omit<…>`, a field type, a type alias, a generic argument.\n *\n * Why the whole family and not `Omit` alone: every one of them makes a reader open a second file and\n * compute the fields (or keys) in their head, none of them can become a DTO class (`class X extends\n * Omit<…>` does not compile — a utility type has no runtime value), and banning `Omit` alone just\n * moves the same computation into `Pick<T, Exclude<keyof T, K>>`. `Record`, `Readonly`, `Array` and\n * friends stay allowed: they do not hide which fields a DTO carries.\n *\n * Every field that decides behaviour is REQUIRED with no default (`.claude/rules/no-rule-defaults.md`):\n * - `mode` — OFF | NEW_AND_MODIFIED_CODE (only changed lines, so existing code is fixed as it is\n * touched) | NEW_AND_MODIFIED_FILES (every occurrence in a changed file) | MODIFIED_PROJECTS /\n * RUN_EVERY_TIME (every occurrence in a touched project / in the repo — #1027).\n * - `paths` — the globs of the API contract libraries this rule judges, e.g. `[\"libraries/apis/**\"]`.\n * An empty list judges nothing.\n *\n * The framework-owned `excludePaths` exempts whole trees inside `paths`. The per-site escape hatch is\n * `// webpieces-disable no-utility-types-in-api-lib -- <reason>` on the line or the line above.\n */\nexport class NoUtilityTypesInApiLibConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n paths!: string[];\n\n static readonly SCHEMA: SchemaShape<NoUtilityTypesInApiLibConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n paths: new FieldDef('string[]'),\n };\n}\n"]}
@@ -41,12 +41,11 @@ export declare class RequiredTypeSuffixEntry {
41
41
  * narrower one never applies there. A failure names the governing entry's glob, so a reader can see
42
42
  * which entry won.
43
43
  *
44
- * `allowedPaths` exempts whole trees inside `paths`. The per-site escape hatch is
44
+ * The framework-owned `excludePaths` exempts whole trees inside `paths`. The per-site escape hatch is
45
45
  * `// webpieces-disable required-type-suffix -- <reason>` on the declaration's line or the line above.
46
46
  */
47
47
  export declare class RequiredTypeSuffixConfig extends BaseRuleConfig {
48
48
  mode?: ModifiedCodeMode;
49
49
  entries: RequiredTypeSuffixEntry[];
50
- allowedPaths?: string[];
51
50
  static readonly SCHEMA: SchemaShape<RequiredTypeSuffixConfig>;
52
51
  }
@@ -49,17 +49,14 @@ exports.RequiredTypeSuffixEntry = RequiredTypeSuffixEntry;
49
49
  * narrower one never applies there. A failure names the governing entry's glob, so a reader can see
50
50
  * which entry won.
51
51
  *
52
- * `allowedPaths` exempts whole trees inside `paths`. The per-site escape hatch is
52
+ * The framework-owned `excludePaths` exempts whole trees inside `paths`. The per-site escape hatch is
53
53
  * `// webpieces-disable required-type-suffix -- <reason>` on the declaration's line or the line above.
54
54
  */
55
55
  class RequiredTypeSuffixConfig extends rules_sdk_1.BaseRuleConfig {
56
56
  entries;
57
- allowedPaths;
58
57
  static SCHEMA = {
59
58
  mode: new rules_sdk_1.FieldDef('string', rules_sdk_2.MODIFIED_CODE_MODES),
60
59
  entries: rules_sdk_1.FieldDef.nonEmptyObjects(RequiredTypeSuffixEntry.SCHEMA),
61
- allowedPaths: rules_sdk_1.FieldDef.optional('string[]'),
62
- ...rules_sdk_1.BASE_RULE_SCHEMA,
63
60
  };
64
61
  }
65
62
  exports.RequiredTypeSuffixConfig = RequiredTypeSuffixConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"required-type-suffix-config.js","sourceRoot":"","sources":["../../../../../../packages/tooling/code-rules/src/configs/required-type-suffix-config.ts"],"names":[],"mappings":";;;AAAA,oDAA+F;AAC/F,oDAA6E;AAC7E;;;GAGG;AACH,MAAa,uBAAuB;IAChC,kFAAkF;IAClF,KAAK,CAAY;IACjB,8FAA8F;IAC9F,QAAQ,CAAY;IACpB,0FAA0F;IAC1F,MAAM,CAAW;IAEjB,MAAM,CAAU,MAAM,GAAyC;QAC3D,KAAK,EAAE,oBAAQ,CAAC,eAAe,EAAE;QACjC,QAAQ,EAAE,oBAAQ,CAAC,eAAe,CAC9B,+GAA+G,CAClH;QACD,MAAM,EAAE,IAAI,oBAAQ,CAAC,SAAS,CAAC;KAClC,CAAC;;AAdN,0DAeC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAa,wBAAyB,SAAQ,0BAAc;IAExD,OAAO,CAA6B;IACpC,YAAY,CAAY;IAExB,MAAM,CAAU,MAAM,GAA0C;QAC5D,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,+BAAmB,CAAC;QACjD,OAAO,EAAE,oBAAQ,CAAC,eAAe,CAAC,uBAAuB,CAAC,MAAM,CAAC;QACjE,YAAY,EAAE,oBAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC3C,GAAG,4BAAgB;KACtB,CAAC;;AAVN,4DAWC","sourcesContent":["import { FieldDef, SchemaShape, BaseRuleConfig, BASE_RULE_SCHEMA } from '@webpieces/rules-sdk';\nimport { ModifiedCodeMode, MODIFIED_CODE_MODES } from '@webpieces/rules-sdk';\n/**\n * One `required-type-suffix` entry: the path globs it covers and the suffixes a type exported from a\n * file under them may end in. Data-only.\n */\nexport class RequiredTypeSuffixEntry {\n /** Workspace-relative globs, e.g. `[\"libraries/apis/internal/**\"]`. Non-empty. */\n paths!: string[];\n /** Case-sensitive suffixes, retained even while this path is explicitly exempt. Non-empty. */\n suffixes!: string[];\n /** Explicit per-path opt-out. Required so an exemption is a named, greppable decision. */\n exempt!: boolean;\n\n static readonly SCHEMA: SchemaShape<RequiredTypeSuffixEntry> = {\n paths: FieldDef.nonEmptyStrings(),\n suffixes: FieldDef.nonEmptyStrings(\n 'To exempt this path, set exempt: true and retain a non-empty suffixes list; suffixes: [] is not an exemption.',\n ),\n exempt: new FieldDef('boolean'),\n };\n}\n\n/**\n * `required-type-suffix` (#1037) — every EXPORTED `interface`, `class` (abstract too), `enum` and `type`\n * alias in a non-test `.ts` file under an entry's `paths` must end in one of that entry's `suffixes`\n * (plain, case-sensitive `endsWith`; the suffix alone is not a name). Why: the suffix tells a reader which\n * LAYER a type belongs to — a `…Dto` is on the wire, a `…Fs` is a Firestore document — where an\n * unsuffixed name reads the same as a server-internal or vendor type.\n *\n * Every field that decides behaviour is REQUIRED with no default (`.claude/rules/no-rule-defaults.md`):\n * - `mode` — OFF | NEW_AND_MODIFIED_CODE (only a type whose declaration line is new or changed — a new or\n * renamed type — so legacy names are grandfathered) | NEW_AND_MODIFIED_FILES (every exported type in a\n * changed file) | MODIFIED_PROJECTS / RUN_EVERY_TIME (every exported type in each touched project / the\n * whole repo — #1027).\n * - `entries` — non-empty; each entry has non-empty `paths` and `suffixes`, and an explicit `exempt` boolean. For example:\n *\n * \"entries\": [\n * { \"paths\": [\"libraries/apis/partner/**\"], \"suffixes\": [\"Dto\", \"Api\"], \"exempt\": true },\n * { \"paths\": [\"libraries/apis/internal/**\"], \"suffixes\": [\"Request\", \"Response\", \"Event\", \"Dto\", \"Api\"], \"exempt\": false },\n * { \"paths\": [\"libraries/browser-node/fs-*-model/**\"], \"suffixes\": [\"Fs\"], \"exempt\": false }\n * ]\n *\n * OVERLAP — the FIRST MATCH in `entries` order wins; suffixes are never unioned. A file is governed by\n * exactly one entry: the entries are read top to bottom, and the first one with a glob matching the file\n * decides its suffixes. ORDER MATTERS: a narrower entry must be listed BEFORE a broader one. With\n * `libraries/apis/internal/**` listed above `libraries/apis/**`, the narrower entry governs\n * `libraries/apis/internal/x/src/A.ts`; listed below it, the broader entry governs that file and the\n * narrower one never applies there. A failure names the governing entry's glob, so a reader can see\n * which entry won.\n *\n * `allowedPaths` exempts whole trees inside `paths`. The per-site escape hatch is\n * `// webpieces-disable required-type-suffix -- <reason>` on the declaration's line or the line above.\n */\nexport class RequiredTypeSuffixConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n entries!: RequiredTypeSuffixEntry[];\n allowedPaths?: string[];\n\n static readonly SCHEMA: SchemaShape<RequiredTypeSuffixConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n entries: FieldDef.nonEmptyObjects(RequiredTypeSuffixEntry.SCHEMA),\n allowedPaths: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n"]}
1
+ {"version":3,"file":"required-type-suffix-config.js","sourceRoot":"","sources":["../../../../../../packages/tooling/code-rules/src/configs/required-type-suffix-config.ts"],"names":[],"mappings":";;;AAAA,oDAA6E;AAC7E,oDAA6E;AAC7E;;;GAGG;AACH,MAAa,uBAAuB;IAChC,kFAAkF;IAClF,KAAK,CAAY;IACjB,8FAA8F;IAC9F,QAAQ,CAAY;IACpB,0FAA0F;IAC1F,MAAM,CAAW;IAEjB,MAAM,CAAU,MAAM,GAAyC;QAC3D,KAAK,EAAE,oBAAQ,CAAC,eAAe,EAAE;QACjC,QAAQ,EAAE,oBAAQ,CAAC,eAAe,CAC9B,+GAA+G,CAClH;QACD,MAAM,EAAE,IAAI,oBAAQ,CAAC,SAAS,CAAC;KAClC,CAAC;;AAdN,0DAeC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAa,wBAAyB,SAAQ,0BAAc;IAExD,OAAO,CAA6B;IAEpC,MAAM,CAAU,MAAM,GAA0C;QAC5D,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,+BAAmB,CAAC;QACjD,OAAO,EAAE,oBAAQ,CAAC,eAAe,CAAC,uBAAuB,CAAC,MAAM,CAAC;KACpE,CAAC;;AAPN,4DAQC","sourcesContent":["import { FieldDef, SchemaShape, BaseRuleConfig } from '@webpieces/rules-sdk';\nimport { ModifiedCodeMode, MODIFIED_CODE_MODES } from '@webpieces/rules-sdk';\n/**\n * One `required-type-suffix` entry: the path globs it covers and the suffixes a type exported from a\n * file under them may end in. Data-only.\n */\nexport class RequiredTypeSuffixEntry {\n /** Workspace-relative globs, e.g. `[\"libraries/apis/internal/**\"]`. Non-empty. */\n paths!: string[];\n /** Case-sensitive suffixes, retained even while this path is explicitly exempt. Non-empty. */\n suffixes!: string[];\n /** Explicit per-path opt-out. Required so an exemption is a named, greppable decision. */\n exempt!: boolean;\n\n static readonly SCHEMA: SchemaShape<RequiredTypeSuffixEntry> = {\n paths: FieldDef.nonEmptyStrings(),\n suffixes: FieldDef.nonEmptyStrings(\n 'To exempt this path, set exempt: true and retain a non-empty suffixes list; suffixes: [] is not an exemption.',\n ),\n exempt: new FieldDef('boolean'),\n };\n}\n\n/**\n * `required-type-suffix` (#1037) — every EXPORTED `interface`, `class` (abstract too), `enum` and `type`\n * alias in a non-test `.ts` file under an entry's `paths` must end in one of that entry's `suffixes`\n * (plain, case-sensitive `endsWith`; the suffix alone is not a name). Why: the suffix tells a reader which\n * LAYER a type belongs to — a `…Dto` is on the wire, a `…Fs` is a Firestore document — where an\n * unsuffixed name reads the same as a server-internal or vendor type.\n *\n * Every field that decides behaviour is REQUIRED with no default (`.claude/rules/no-rule-defaults.md`):\n * - `mode` — OFF | NEW_AND_MODIFIED_CODE (only a type whose declaration line is new or changed — a new or\n * renamed type — so legacy names are grandfathered) | NEW_AND_MODIFIED_FILES (every exported type in a\n * changed file) | MODIFIED_PROJECTS / RUN_EVERY_TIME (every exported type in each touched project / the\n * whole repo — #1027).\n * - `entries` — non-empty; each entry has non-empty `paths` and `suffixes`, and an explicit `exempt` boolean. For example:\n *\n * \"entries\": [\n * { \"paths\": [\"libraries/apis/partner/**\"], \"suffixes\": [\"Dto\", \"Api\"], \"exempt\": true },\n * { \"paths\": [\"libraries/apis/internal/**\"], \"suffixes\": [\"Request\", \"Response\", \"Event\", \"Dto\", \"Api\"], \"exempt\": false },\n * { \"paths\": [\"libraries/browser-node/fs-*-model/**\"], \"suffixes\": [\"Fs\"], \"exempt\": false }\n * ]\n *\n * OVERLAP — the FIRST MATCH in `entries` order wins; suffixes are never unioned. A file is governed by\n * exactly one entry: the entries are read top to bottom, and the first one with a glob matching the file\n * decides its suffixes. ORDER MATTERS: a narrower entry must be listed BEFORE a broader one. With\n * `libraries/apis/internal/**` listed above `libraries/apis/**`, the narrower entry governs\n * `libraries/apis/internal/x/src/A.ts`; listed below it, the broader entry governs that file and the\n * narrower one never applies there. A failure names the governing entry's glob, so a reader can see\n * which entry won.\n *\n * The framework-owned `excludePaths` exempts whole trees inside `paths`. The per-site escape hatch is\n * `// webpieces-disable required-type-suffix -- <reason>` on the declaration's line or the line above.\n */\nexport class RequiredTypeSuffixConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n entries!: RequiredTypeSuffixEntry[];\n\n static readonly SCHEMA: SchemaShape<RequiredTypeSuffixConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n entries: FieldDef.nonEmptyObjects(RequiredTypeSuffixEntry.SCHEMA),\n };\n}\n"]}
@@ -25,7 +25,6 @@ export declare class MaxFileLinesConfig extends BaseRuleConfig {
25
25
  mode?: FileLimitMode;
26
26
  limit?: number;
27
27
  disableAllowed?: boolean;
28
- allowedPaths?: string[];
29
28
  static readonly SCHEMA: SchemaShape<MaxFileLinesConfig>;
30
29
  }
31
30
  export declare class RequireReturnTypeConfig extends BaseRuleConfig {
@@ -67,7 +66,6 @@ export declare class NoDestructureConfig extends BaseRuleConfig {
67
66
  mode?: ModifiedCodeMode;
68
67
  allowTopLevel?: boolean;
69
68
  disableAllowed?: boolean;
70
- allowedPaths?: string[];
71
69
  static readonly SCHEMA: SchemaShape<NoDestructureConfig>;
72
70
  }
73
71
  export declare class NoUnmanagedExceptionsConfig extends BaseRuleConfig {
@@ -95,7 +93,6 @@ export declare class NoCustomCssConfig extends BaseRuleConfig {
95
93
  export declare class NoSymbolDiTokensConfig extends BaseRuleConfig {
96
94
  mode?: ModifiedCodeMode;
97
95
  disableAllowed?: boolean;
98
- allowedPaths?: string[];
99
96
  static readonly SCHEMA: SchemaShape<NoSymbolDiTokensConfig>;
100
97
  }
101
98
  export declare class NoProcessExitOutsideMainConfig extends BaseRuleConfig {
@@ -106,13 +103,11 @@ export declare class NoProcessExitOutsideMainConfig extends BaseRuleConfig {
106
103
  export declare class NoFunctionOutsideClassConfig extends BaseRuleConfig {
107
104
  mode?: ModifiedCodeMode;
108
105
  disableAllowed?: boolean;
109
- allowedPaths?: string[];
110
106
  static readonly SCHEMA: SchemaShape<NoFunctionOutsideClassConfig>;
111
107
  }
112
108
  export declare class InjectAnnotationNotNeededForConcreteClassConfig extends BaseRuleConfig {
113
109
  mode?: ModifiedCodeMode;
114
110
  disableAllowed?: boolean;
115
- allowedPaths?: string[];
116
111
  static readonly SCHEMA: SchemaShape<InjectAnnotationNotNeededForConcreteClassConfig>;
117
112
  }
118
113
  export declare class FrameworkTagConfig extends BaseRuleConfig {
@@ -51,30 +51,25 @@ class MaxMethodLinesConfig extends rules_sdk_2.BaseRuleConfig {
51
51
  mode: new rules_sdk_3.FieldDef('string', exports.METHOD_LIMIT_MODES),
52
52
  limit: rules_sdk_3.FieldDef.optional('number'),
53
53
  disableAllowed: rules_sdk_3.FieldDef.optional('boolean'),
54
- ...rules_sdk_2.BASE_RULE_SCHEMA,
55
54
  };
56
55
  }
57
56
  exports.MaxMethodLinesConfig = MaxMethodLinesConfig;
58
57
  // max-file-lines — caps a file's line count.
59
58
  //
60
- // `allowedPaths` exempts whole file trees, matched with the shared `isPathExcluded` glob/prefix/segment
61
- // semantics (the same field, same matcher and same meaning as no-function-outside-class / no-js-files /
62
- // no-destructure). It is for files the repo did NOT author and cannot shrink — never a standing amnesty
63
- // for hand-written code, which is what the inline disable and a refactor are for.
59
+ // The framework-owned `excludePaths` (every rule accepts it, the dispatcher applies it — #1253) exempts
60
+ // whole file trees. For this rule it is for files the repo did NOT author and cannot shrink — never a
61
+ // standing amnesty for hand-written code, which is what the inline disable and a refactor are for.
64
62
  //
65
63
  // The machine-generated trees in GENERATED_CODE_PATHS are exempt WITHOUT configuration, and
66
- // `allowedPaths` ADDS to that floor rather than replacing it — see generated-code-paths.ts for why a
64
+ // `excludePaths` ADDS to that floor rather than replacing it — see generated-code-paths.ts for why a
67
65
  // 42,000-line graphql-codegen output must not be able to cost a repo the whole rule.
68
66
  class MaxFileLinesConfig extends rules_sdk_2.BaseRuleConfig {
69
67
  limit;
70
68
  disableAllowed;
71
- allowedPaths;
72
69
  static SCHEMA = {
73
70
  mode: new rules_sdk_3.FieldDef('string', rules_sdk_1.FILE_LIMIT_MODES),
74
71
  limit: rules_sdk_3.FieldDef.optional('number'),
75
72
  disableAllowed: rules_sdk_3.FieldDef.optional('boolean'),
76
- allowedPaths: rules_sdk_3.FieldDef.optional('string[]'),
77
- ...rules_sdk_2.BASE_RULE_SCHEMA,
78
73
  };
79
74
  }
80
75
  exports.MaxFileLinesConfig = MaxFileLinesConfig;
@@ -83,7 +78,6 @@ class RequireReturnTypeConfig extends rules_sdk_2.BaseRuleConfig {
83
78
  static SCHEMA = {
84
79
  mode: new rules_sdk_3.FieldDef('string', exports.RETURN_TYPE_MODES),
85
80
  disableAllowed: rules_sdk_3.FieldDef.optional('boolean'),
86
- ...rules_sdk_2.BASE_RULE_SCHEMA,
87
81
  };
88
82
  }
89
83
  exports.RequireReturnTypeConfig = RequireReturnTypeConfig;
@@ -92,7 +86,6 @@ class NoInlineTypeLiteralsConfig extends rules_sdk_2.BaseRuleConfig {
92
86
  static SCHEMA = {
93
87
  mode: new rules_sdk_3.FieldDef('string', exports.INLINE_TYPE_MODES),
94
88
  disableAllowed: rules_sdk_3.FieldDef.optional('boolean'),
95
- ...rules_sdk_2.BASE_RULE_SCHEMA,
96
89
  };
97
90
  }
98
91
  exports.NoInlineTypeLiteralsConfig = NoInlineTypeLiteralsConfig;
@@ -101,7 +94,6 @@ class NoAnyUnknownConfig extends rules_sdk_2.BaseRuleConfig {
101
94
  static SCHEMA = {
102
95
  mode: new rules_sdk_3.FieldDef('string', rules_sdk_1.MODIFIED_CODE_MODES),
103
96
  disableAllowed: rules_sdk_3.FieldDef.optional('boolean'),
104
- ...rules_sdk_2.BASE_RULE_SCHEMA,
105
97
  };
106
98
  }
107
99
  exports.NoAnyUnknownConfig = NoAnyUnknownConfig;
@@ -110,7 +102,6 @@ class NoImplicitAnyConfig extends rules_sdk_2.BaseRuleConfig {
110
102
  static SCHEMA = {
111
103
  mode: new rules_sdk_3.FieldDef('string', rules_sdk_1.MODIFIED_CODE_MODES),
112
104
  disableAllowed: rules_sdk_3.FieldDef.optional('boolean'),
113
- ...rules_sdk_2.BASE_RULE_SCHEMA,
114
105
  };
115
106
  }
116
107
  exports.NoImplicitAnyConfig = NoImplicitAnyConfig;
@@ -123,7 +114,6 @@ class PrismaValidateDtosConfig extends rules_sdk_2.BaseRuleConfig {
123
114
  disableAllowed: rules_sdk_3.FieldDef.optional('boolean'),
124
115
  prismaSchemaPath: rules_sdk_3.FieldDef.optional('string'),
125
116
  dtoSourcePaths: rules_sdk_3.FieldDef.optional('string[]'),
126
- ...rules_sdk_2.BASE_RULE_SCHEMA,
127
117
  };
128
118
  }
129
119
  exports.PrismaValidateDtosConfig = PrismaValidateDtosConfig;
@@ -138,24 +128,20 @@ class PrismaConverterConfig extends rules_sdk_2.BaseRuleConfig {
138
128
  schemaPath: rules_sdk_3.FieldDef.optional('string'),
139
129
  convertersPaths: rules_sdk_3.FieldDef.optional('string[]'),
140
130
  enforcePaths: rules_sdk_3.FieldDef.optional('string[]'),
141
- ...rules_sdk_2.BASE_RULE_SCHEMA,
142
131
  };
143
132
  }
144
133
  exports.PrismaConverterConfig = PrismaConverterConfig;
145
- // `allowedPaths` exempts whole file trees whose idioms are destructuring by construction (React /
146
- // React Native components and hooks — `const [x, setX] = useState()`, destructured props — framework
147
- // glue), matched with the shared glob/prefix/segment semantics of `isPathExcluded`. It is the ONLY
148
- // escape when `disableAllowed: false`, since that setting deliberately ignores inline disables.
134
+ // The framework-owned `excludePaths` exempts whole file trees whose idioms are destructuring by
135
+ // construction (React / React Native components and hooks — `const [x, setX] = useState()`, destructured
136
+ // props — framework glue). It is the ONLY escape when `disableAllowed: false`, since that setting
137
+ // deliberately ignores inline disables.
149
138
  class NoDestructureConfig extends rules_sdk_2.BaseRuleConfig {
150
139
  allowTopLevel;
151
140
  disableAllowed;
152
- allowedPaths;
153
141
  static SCHEMA = {
154
142
  mode: new rules_sdk_3.FieldDef('string', rules_sdk_1.MODIFIED_CODE_MODES),
155
143
  allowTopLevel: rules_sdk_3.FieldDef.optional('boolean'),
156
144
  disableAllowed: rules_sdk_3.FieldDef.optional('boolean'),
157
- allowedPaths: rules_sdk_3.FieldDef.optional('string[]'),
158
- ...rules_sdk_2.BASE_RULE_SCHEMA,
159
145
  };
160
146
  }
161
147
  exports.NoDestructureConfig = NoDestructureConfig;
@@ -164,7 +150,6 @@ class NoUnmanagedExceptionsConfig extends rules_sdk_2.BaseRuleConfig {
164
150
  static SCHEMA = {
165
151
  mode: new rules_sdk_3.FieldDef('string', rules_sdk_1.MODIFIED_CODE_MODES),
166
152
  disableAllowed: rules_sdk_3.FieldDef.optional('boolean'),
167
- ...rules_sdk_2.BASE_RULE_SCHEMA,
168
153
  };
169
154
  }
170
155
  exports.NoUnmanagedExceptionsConfig = NoUnmanagedExceptionsConfig;
@@ -173,7 +158,6 @@ class CatchErrorPatternConfig extends rules_sdk_2.BaseRuleConfig {
173
158
  static SCHEMA = {
174
159
  mode: new rules_sdk_3.FieldDef('string', rules_sdk_1.MODIFIED_CODE_MODES),
175
160
  disableAllowed: rules_sdk_3.FieldDef.optional('boolean'),
176
- ...rules_sdk_2.BASE_RULE_SCHEMA,
177
161
  };
178
162
  }
179
163
  exports.CatchErrorPatternConfig = CatchErrorPatternConfig;
@@ -184,7 +168,6 @@ class AngularNoDirectApiInResolverConfig extends rules_sdk_2.BaseRuleConfig {
184
168
  mode: new rules_sdk_3.FieldDef('string', exports.DIRECT_API_RESOLVER_MODES),
185
169
  disableAllowed: rules_sdk_3.FieldDef.optional('boolean'),
186
170
  enforcePaths: rules_sdk_3.FieldDef.optional('string[]'),
187
- ...rules_sdk_2.BASE_RULE_SCHEMA,
188
171
  };
189
172
  }
190
173
  exports.AngularNoDirectApiInResolverConfig = AngularNoDirectApiInResolverConfig;
@@ -198,18 +181,14 @@ class NoCustomCssConfig extends rules_sdk_2.BaseRuleConfig {
198
181
  mode: new rules_sdk_3.FieldDef('string', rules_sdk_1.MODIFIED_CODE_MODES),
199
182
  disableAllowed: rules_sdk_3.FieldDef.optional('boolean'),
200
183
  allowGlobs: rules_sdk_3.FieldDef.optional('string[]'),
201
- ...rules_sdk_2.BASE_RULE_SCHEMA,
202
184
  };
203
185
  }
204
186
  exports.NoCustomCssConfig = NoCustomCssConfig;
205
187
  class NoSymbolDiTokensConfig extends rules_sdk_2.BaseRuleConfig {
206
188
  disableAllowed;
207
- allowedPaths;
208
189
  static SCHEMA = {
209
190
  mode: new rules_sdk_3.FieldDef('string', rules_sdk_1.MODIFIED_CODE_MODES),
210
191
  disableAllowed: rules_sdk_3.FieldDef.optional('boolean'),
211
- allowedPaths: rules_sdk_3.FieldDef.optional('string[]'),
212
- ...rules_sdk_2.BASE_RULE_SCHEMA,
213
192
  };
214
193
  }
215
194
  exports.NoSymbolDiTokensConfig = NoSymbolDiTokensConfig;
@@ -222,7 +201,6 @@ class NoProcessExitOutsideMainConfig extends rules_sdk_2.BaseRuleConfig {
222
201
  static SCHEMA = {
223
202
  mode: new rules_sdk_3.FieldDef('string', rules_sdk_1.MODIFIED_CODE_MODES),
224
203
  disableAllowed: rules_sdk_3.FieldDef.optional('boolean'),
225
- ...rules_sdk_2.BASE_RULE_SCHEMA,
226
204
  };
227
205
  }
228
206
  exports.NoProcessExitOutsideMainConfig = NoProcessExitOutsideMainConfig;
@@ -232,17 +210,14 @@ exports.NoProcessExitOutsideMainConfig = NoProcessExitOutsideMainConfig;
232
210
  // dead-end the DI graph can't reach. Inline callbacks, nested functions inside methods, and non-function
233
211
  // top-level consts (objects, zod schemas, primitives) are NOT flagged. Standard rollout knobs via the
234
212
  // base: mode (OFF | NEW_AND_MODIFIED_CODE | NEW_AND_MODIFIED_FILES), turnOffRuleUntilEpoch, branch,
235
- // and disableAllowed for the inline `// webpieces-disable` escape. `allowedPaths` exempts whole file
236
- // trees that legitimately live outside the class-per-behavior model (e.g. React component/hook files,
237
- // framework glue), matched with the shared glob/prefix/segment semantics of `isPathExcluded`.
213
+ // and disableAllowed for the inline `// webpieces-disable` escape. The framework-owned `excludePaths`
214
+ // exempts whole file trees that legitimately live outside the class-per-behavior model (e.g. React
215
+ // component/hook files, framework glue).
238
216
  class NoFunctionOutsideClassConfig extends rules_sdk_2.BaseRuleConfig {
239
217
  disableAllowed;
240
- allowedPaths;
241
218
  static SCHEMA = {
242
219
  mode: new rules_sdk_3.FieldDef('string', rules_sdk_1.MODIFIED_CODE_MODES),
243
220
  disableAllowed: rules_sdk_3.FieldDef.optional('boolean'),
244
- allowedPaths: rules_sdk_3.FieldDef.optional('string[]'),
245
- ...rules_sdk_2.BASE_RULE_SCHEMA,
246
221
  };
247
222
  }
248
223
  exports.NoFunctionOutsideClassConfig = NoFunctionOutsideClassConfig;
@@ -254,16 +229,13 @@ exports.NoFunctionOutsideClassConfig = NoFunctionOutsideClassConfig;
254
229
  // tokens are NOT flagged because they never equal the type (`@inject(FOO_TOKEN) x: Provider<Foo>`).
255
230
  // AI keeps carpet-bombing `@inject`; this fails the build on the redundant form. Standard rollout knobs
256
231
  // via the base: mode (OFF | NEW_AND_MODIFIED_CODE | NEW_AND_MODIFIED_FILES), turnOffRuleUntilEpoch,
257
- // branch, and disableAllowed for the inline `// webpieces-disable` escape. `allowedPaths` exempts whole
258
- // file trees, matched with the shared glob/prefix/segment semantics.
232
+ // branch, and disableAllowed for the inline `// webpieces-disable` escape. The framework-owned
233
+ // `excludePaths` exempts whole file trees.
259
234
  class InjectAnnotationNotNeededForConcreteClassConfig extends rules_sdk_2.BaseRuleConfig {
260
235
  disableAllowed;
261
- allowedPaths;
262
236
  static SCHEMA = {
263
237
  mode: new rules_sdk_3.FieldDef('string', rules_sdk_1.MODIFIED_CODE_MODES),
264
238
  disableAllowed: rules_sdk_3.FieldDef.optional('boolean'),
265
- allowedPaths: rules_sdk_3.FieldDef.optional('string[]'),
266
- ...rules_sdk_2.BASE_RULE_SCHEMA,
267
239
  };
268
240
  }
269
241
  exports.InjectAnnotationNotNeededForConcreteClassConfig = InjectAnnotationNotNeededForConcreteClassConfig;
@@ -279,7 +251,6 @@ class FrameworkTagConfig extends rules_sdk_2.BaseRuleConfig {
279
251
  static SCHEMA = {
280
252
  mode: new rules_sdk_3.FieldDef('string', exports.PROJECT_MODES),
281
253
  knownTypes: rules_sdk_3.FieldDef.optional('string[]'),
282
- ...rules_sdk_2.BASE_RULE_SCHEMA,
283
254
  };
284
255
  }
285
256
  exports.FrameworkTagConfig = FrameworkTagConfig;
@@ -294,7 +265,6 @@ class RoleTagConfig extends rules_sdk_2.BaseRuleConfig {
294
265
  static SCHEMA = {
295
266
  mode: new rules_sdk_3.FieldDef('string', exports.PROJECT_MODES),
296
267
  knownTypes: rules_sdk_3.FieldDef.optional('string[]'),
297
- ...rules_sdk_2.BASE_RULE_SCHEMA,
298
268
  };
299
269
  }
300
270
  exports.RoleTagConfig = RoleTagConfig;
@@ -302,7 +272,6 @@ exports.RoleTagConfig = RoleTagConfig;
302
272
  class EnsureWeAreSecureConfig extends rules_sdk_2.BaseRuleConfig {
303
273
  static SCHEMA = {
304
274
  mode: new rules_sdk_3.FieldDef('string', exports.PROJECT_MODES),
305
- ...rules_sdk_2.BASE_RULE_SCHEMA,
306
275
  };
307
276
  }
308
277
  exports.EnsureWeAreSecureConfig = EnsureWeAreSecureConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"rule-configs.js","sourceRoot":"","sources":["../../../../../../packages/tooling/code-rules/src/configs/rule-configs.ts"],"names":[],"mappings":";;;AAAA,oDAA8G;AAC9G,oDAAwE;AACxE,oDAA6D;AAC7D,kFAAkF;AAClF,yFAAyF;AAEzF,uFAAuF;AACvF,0FAA0F;AAC1F,2FAA2F;AAC3F,qDAAqD;AACxC,QAAA,kBAAkB,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,0BAA0B,EAAE,wBAAwB,CAAU,CAAC;AAI3G,QAAA,iBAAiB,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,0BAA0B,EAAE,wBAAwB,CAAU,CAAC;AAI1G,QAAA,iBAAiB,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,0BAA0B,EAAE,wBAAwB,CAAU,CAAC;AAIvH,iGAAiG;AACjG,gGAAgG;AAChG,8EAA8E;AACjE,QAAA,aAAa,GAAG,CAAC,KAAK,EAAE,mBAAmB,CAAU,CAAC;AAItD,QAAA,iBAAiB,GAAG,CAAC,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,CAAU,CAAC;AAIjF,QAAA,sBAAsB,GAAG,CAAC,KAAK,EAAE,0BAA0B,EAAE,wBAAwB,CAAU,CAAC;AAIhG,QAAA,yBAAyB,GAAG,CAAC,KAAK,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,wBAA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ES, ModifiedCodeMode, MODIFIED_CODE_MODES } from \"@webpieces/rules-sdk\";\nimport { BaseRuleConfig, BASE_RULE_SCHEMA } from \"@webpieces/rules-sdk\";\nimport { FieldDef, SchemaShape } from \"@webpieces/rules-sdk\";\n// Mode const arrays — TypeScript union types derived from them, and FieldDef enum\n// values reference the same array. Impossible for the type and runtime check to diverge.\n\n// Single source of truth for rule \"mode\" values. Exported so code-rules (and any other\n// consumer) imports these instead of re-declaring the same unions — a rename here ripples\n// everywhere at compile time. The FieldDef SCHEMA below references the same arrays, so the\n// type and the runtime validation can never diverge.\nexport const METHOD_LIMIT_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'NEW_AND_MODIFIED_FILES'] as const;\n\nexport type MethodLimitMode = typeof METHOD_LIMIT_MODES[number];\n\nexport const RETURN_TYPE_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'NEW_AND_MODIFIED_FILES'] as const;\n\nexport type ReturnTypeMode = typeof RETURN_TYPE_MODES[number];\n\nexport const INLINE_TYPE_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'NEW_AND_MODIFIED_FILES'] as const;\n\nexport type InlineTypeMode = typeof INLINE_TYPE_MODES[number];\n\n// PROJECT-level rules (e.g. framework-tag): the check is neither line- nor file-scoped — it runs\n// for a whole project when ANY file the project owns is touched. `MODIFIED_PROJECTS` names that\n// honestly (nx `affected` already narrows execution to the changed projects).\nexport const PROJECT_MODES = ['OFF', 'MODIFIED_PROJECTS'] as const;\n\nexport type ProjectMode = typeof PROJECT_MODES[number];\n\nexport const PRISMA_DTOS_MODES = ['OFF', 'MODIFIED_CLASS', 'NEW_AND_MODIFIED_FILES'] as const;\n\nexport type PrismaValidateDtosMode = typeof PRISMA_DTOS_MODES[number];\n\nexport const PRISMA_CONVERTER_MODES = ['OFF', 'NEW_AND_MODIFIED_METHODS', 'NEW_AND_MODIFIED_FILES'] as const;\n\nexport type PrismaConverterMode = typeof PRISMA_CONVERTER_MODES[number];\n\nexport const DIRECT_API_RESOLVER_MODES = ['OFF', 'NEW_AND_MODIFIED_CODE', 'NEW_AND_MODIFIED_METHODS', 'NEW_AND_MODIFIED_FILES'] as const;\n\nexport type DirectApiResolverMode = typeof DIRECT_API_RESOLVER_MODES[number];\n\n// ---------------------------------------------------------------------------\n// Universal escape hatches — EVERY rule supports temporarily disabling itself\n// either while on a named git branch (turnOffRuleWhileOnBranch) or until an\n// epoch passes (turnOffRuleUntilEpoch). They live on a shared base class so the\n// fields (and their schema entries) are declared once instead of repeated per\n// rule. `mode` stays per-rule because its allowed values vary (ON/OFF vs\n// NEW_AND_MODIFIED_CODE vs NEW_AND_MODIFIED_METHODS, etc).\n//\n// BOTH fields are REQUIRED on every rule so both hatches are ALWAYS VISIBLE in the config — an AI\n// editing webpieces.config.json sees them on every rule and cannot miss that a rule can be time-boxed\n// or branch-scoped off. Convention:\n// turnOffRuleUntilEpoch: 0 = rule active (epoch in the past); a future unix epoch IN SECONDS =\n// temporarily disabled until that moment.\n// turnOffRuleWhileOnBranch: null = always on; a branch name = disabled while that branch is checked out.\n// The name is matched EXACTLY (===). Globs/wildcards are NOT supported and\n// must not be added: a pattern would switch a rule off on branches nobody\n// enumerated. It is also ignored (loudly — shouldSkipRule throws) on a pull\n// request from a FORK, where the branch name is the contributor's to choose.\n// Required-but-nullable so its \"unset\" state is present-and-visible (null)\n// rather than omitted.\n// The earlier spellings of these two fields were RENAMED to the names above and are no longer accepted —\n// the validator rejects them with a \"renamed to X\" hint. RENAMED_FIELD_ALIASES in validate-config.ts is\n// the ONE place in src/ a dead spelling may still be written (see escape-hatch-key-spelling.spec.ts).\n// ---------------------------------------------------------------------------\nexport class MaxMethodLinesConfig extends BaseRuleConfig {\n declare mode?: MethodLimitMode;\n limit?: number;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<MaxMethodLinesConfig> = {\n mode: new FieldDef('string', METHOD_LIMIT_MODES),\n limit: FieldDef.optional('number'),\n disableAllowed: FieldDef.optional('boolean'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\n// max-file-lines — caps a file's line count.\n//\n// `allowedPaths` exempts whole file trees, matched with the shared `isPathExcluded` glob/prefix/segment\n// semantics (the same field, same matcher and same meaning as no-function-outside-class / no-js-files /\n// no-destructure). It is for files the repo did NOT author and cannot shrink — never a standing amnesty\n// for hand-written code, which is what the inline disable and a refactor are for.\n//\n// The machine-generated trees in GENERATED_CODE_PATHS are exempt WITHOUT configuration, and\n// `allowedPaths` ADDS to that floor rather than replacing it — see generated-code-paths.ts for why a\n// 42,000-line graphql-codegen output must not be able to cost a repo the whole rule.\nexport class MaxFileLinesConfig extends BaseRuleConfig {\n declare mode?: FileLimitMode;\n limit?: number;\n disableAllowed?: boolean;\n allowedPaths?: string[];\n\n static readonly SCHEMA: SchemaShape<MaxFileLinesConfig> = {\n mode: new FieldDef('string', FILE_LIMIT_MODES),\n limit: FieldDef.optional('number'),\n disableAllowed: FieldDef.optional('boolean'),\n allowedPaths: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class RequireReturnTypeConfig extends BaseRuleConfig {\n declare mode?: ReturnTypeMode;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<RequireReturnTypeConfig> = {\n mode: new FieldDef('string', RETURN_TYPE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class NoInlineTypeLiteralsConfig extends BaseRuleConfig {\n declare mode?: InlineTypeMode;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<NoInlineTypeLiteralsConfig> = {\n mode: new FieldDef('string', INLINE_TYPE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class NoAnyUnknownConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<NoAnyUnknownConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class NoImplicitAnyConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<NoImplicitAnyConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class PrismaValidateDtosConfig extends BaseRuleConfig {\n declare mode?: PrismaValidateDtosMode;\n disableAllowed?: boolean;\n prismaSchemaPath?: string;\n dtoSourcePaths?: string[];\n\n static readonly SCHEMA: SchemaShape<PrismaValidateDtosConfig> = {\n mode: new FieldDef('string', PRISMA_DTOS_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n prismaSchemaPath: FieldDef.optional('string'),\n dtoSourcePaths: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class PrismaConverterConfig extends BaseRuleConfig {\n declare mode?: PrismaConverterMode;\n disableAllowed?: boolean;\n schemaPath?: string;\n convertersPaths?: string[];\n enforcePaths?: string[];\n\n static readonly SCHEMA: SchemaShape<PrismaConverterConfig> = {\n mode: new FieldDef('string', PRISMA_CONVERTER_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n schemaPath: FieldDef.optional('string'),\n convertersPaths: FieldDef.optional('string[]'),\n enforcePaths: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\n// `allowedPaths` exempts whole file trees whose idioms are destructuring by construction (React /\n// React Native components and hooks — `const [x, setX] = useState()`, destructured props — framework\n// glue), matched with the shared glob/prefix/segment semantics of `isPathExcluded`. It is the ONLY\n// escape when `disableAllowed: false`, since that setting deliberately ignores inline disables.\nexport class NoDestructureConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n allowTopLevel?: boolean;\n disableAllowed?: boolean;\n allowedPaths?: string[];\n\n static readonly SCHEMA: SchemaShape<NoDestructureConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n allowTopLevel: FieldDef.optional('boolean'),\n disableAllowed: FieldDef.optional('boolean'),\n allowedPaths: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class NoUnmanagedExceptionsConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<NoUnmanagedExceptionsConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class CatchErrorPatternConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<CatchErrorPatternConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class AngularNoDirectApiInResolverConfig extends BaseRuleConfig {\n declare mode?: DirectApiResolverMode;\n disableAllowed?: boolean;\n enforcePaths?: string[];\n\n static readonly SCHEMA: SchemaShape<AngularNoDirectApiInResolverConfig> = {\n mode: new FieldDef('string', DIRECT_API_RESOLVER_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n enforcePaths: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\n// Bans hand-written CSS in Angular sources (styles:/styleUrls:/styleUrl: in @Component, and inline\n// style=/[style.x]/[ngStyle] in templates) so teams style with Tailwind utility classes. `allowGlobs`\n// exempts paths WITHIN the Angular scope (e.g. a vendored Fuse kit copied verbatim with its own CSS).\nexport class NoCustomCssConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n allowGlobs?: string[];\n\n static readonly SCHEMA: SchemaShape<NoCustomCssConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n allowGlobs: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class NoSymbolDiTokensConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n allowedPaths?: string[];\n\n static readonly SCHEMA: SchemaShape<NoSymbolDiTokensConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n allowedPaths: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\n// Flags `process.exit(...)` outside a main()/runMain wrapper (and `import { main }`) so a deep exit\n// can't silently kill a reused server/command. Gradual-rollout knobs via the standard base: mode\n// (OFF | NEW_AND_MODIFIED_CODE | NEW_AND_MODIFIED_FILES), turnOffRuleUntilEpoch, branch, and\n// disableAllowed for the inline `// webpieces-disable` escape at genuine terminal boundaries.\nexport class NoProcessExitOutsideMainConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<NoProcessExitOutsideMainConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\n// Flags a function CREATED OUTSIDE A CLASS at module scope: a top-level `function foo()` declaration\n// or a top-level `const foo = () => {}` / `= function(){}`. The point is that webpieces DI +\n// @DocumentDesign only work when behavior lives in injectable classes — a module-scope function is a\n// dead-end the DI graph can't reach. Inline callbacks, nested functions inside methods, and non-function\n// top-level consts (objects, zod schemas, primitives) are NOT flagged. Standard rollout knobs via the\n// base: mode (OFF | NEW_AND_MODIFIED_CODE | NEW_AND_MODIFIED_FILES), turnOffRuleUntilEpoch, branch,\n// and disableAllowed for the inline `// webpieces-disable` escape. `allowedPaths` exempts whole file\n// trees that legitimately live outside the class-per-behavior model (e.g. React component/hook files,\n// framework glue), matched with the shared glob/prefix/segment semantics of `isPathExcluded`.\nexport class NoFunctionOutsideClassConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n allowedPaths?: string[];\n\n static readonly SCHEMA: SchemaShape<NoFunctionOutsideClassConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n allowedPaths: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\n// inject-annotation-not-needed-for-concrete-class — flags a REDUNDANT `@inject(X)` whose token is\n// textually identical to the parameter's own declared type (`@inject(Foo) private readonly foo: Foo`).\n// In this inversify setup the decorator is pure noise there: reflect-metadata (emitDecoratorMetadata)\n// already resolves a constructor parameter by its class type, so `private readonly foo: Foo` binds on\n// its own (see CLAUDE.md, and the no-symbol-di-tokens rule that pushes the same way). Symbol/interface\n// tokens are NOT flagged because they never equal the type (`@inject(FOO_TOKEN) x: Provider<Foo>`).\n// AI keeps carpet-bombing `@inject`; this fails the build on the redundant form. Standard rollout knobs\n// via the base: mode (OFF | NEW_AND_MODIFIED_CODE | NEW_AND_MODIFIED_FILES), turnOffRuleUntilEpoch,\n// branch, and disableAllowed for the inline `// webpieces-disable` escape. `allowedPaths` exempts whole\n// file trees, matched with the shared glob/prefix/segment semantics.\nexport class InjectAnnotationNotNeededForConcreteClassConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n allowedPaths?: string[];\n\n static readonly SCHEMA: SchemaShape<InjectAnnotationNotNeededForConcreteClassConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n allowedPaths: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\n// framework-tag — every project that a changed source file belongs to must carry >=1\n// `framework:<browser|react|angular|node|express|react-native>` nx tag in its project.json. Those tags are the\n// project's \"libType\" — the SET of runtime environments it runs in — and the source of truth for\n// the dependencies.json `framework` field and the `library-types-match-client` rule. Multiple tags\n// are allowed (the env set) and values are validated against the known set (`framework:all` is a\n// hard error). `knownTypes` customizes that set (defaults to browser, react, angular, node, express,\n// react-native — the last a first-class runtime, not a browser, #1064).\nexport class FrameworkTagConfig extends BaseRuleConfig {\n declare mode?: ProjectMode;\n knownTypes?: string[];\n\n static readonly SCHEMA: SchemaShape<FrameworkTagConfig> = {\n mode: new FieldDef('string', PROJECT_MODES),\n knownTypes: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\n// role-tag — every project that a changed source file belongs to must carry a\n// `role:<server|app|bundle|designed-lib|lib|client|api-lib|api-client>` nx tag in its project.json. That tag is the project's\n// ROLE (orthogonal to `framework` libType) — the source of truth for the dependencies.json `role`\n// field, the `role-dependency` edge rule (apps are never depended upon), and DI-design generation\n// (server→@Controller, designed-lib→@ApiImplementation, lib→none, client→angular design).\n// `knownTypes` customizes the list suggested to the author when a tag is missing.\nexport class RoleTagConfig extends BaseRuleConfig {\n declare mode?: ProjectMode;\n knownTypes?: string[];\n\n static readonly SCHEMA: SchemaShape<RoleTagConfig> = {\n mode: new FieldDef('string', PROJECT_MODES),\n knownTypes: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\n// Touching a project audits every production API contract it directly owns.\nexport class EnsureWeAreSecureConfig extends BaseRuleConfig {\n declare mode?: ProjectMode;\n static readonly SCHEMA: SchemaShape<EnsureWeAreSecureConfig> = {\n mode: new FieldDef('string', PROJECT_MODES),\n ...BASE_RULE_SCHEMA,\n };\n}\n"]}
1
+ {"version":3,"file":"rule-configs.js","sourceRoot":"","sources":["../../../../../../packages/tooling/code-rules/src/configs/rule-configs.ts"],"names":[],"mappings":";;;AAAA,oDAA8G;AAC9G,oDAAsD;AACtD,oDAA6D;AAC7D,kFAAkF;AAClF,yFAAyF;AAEzF,uFAAuF;AACvF,0FAA0F;AAC1F,2FAA2F;AAC3F,qDAAqD;AACxC,QAAA,kBAAkB,GAAG,CAAC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U,MAAM,GAAiE;QACnF,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,+BAAmB,CAAC;QACjD,cAAc,EAAE,oBAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC;KAC/C,CAAC;;AAPN,0GAQC;AAED,qFAAqF;AACrF,+GAA+G;AAC/G,iGAAiG;AACjG,mGAAmG;AACnG,iGAAiG;AACjG,qGAAqG;AACrG,wEAAwE;AACxE,MAAa,kBAAmB,SAAQ,0BAAc;IAElD,UAAU,CAAY;IAEtB,MAAM,CAAU,MAAM,GAAoC;QACtD,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,qBAAa,CAAC;QAC3C,UAAU,EAAE,oBAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;KAC5C,CAAC;;AAPN,gDAQC;AAED,8EAA8E;AAC9E,8HAA8H;AAC9H,kGAAkG;AAClG,kGAAkG;AAClG,0FAA0F;AAC1F,kFAAkF;AAClF,MAAa,aAAc,SAAQ,0BAAc;IAE7C,UAAU,CAAY;IAEtB,MAAM,CAAU,MAAM,GAA+B;QACjD,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,qBAAa,CAAC;QAC3C,UAAU,EAAE,oBAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;KAC5C,CAAC;;AAPN,sCAQC;AAED,4EAA4E;AAC5E,MAAa,uBAAwB,SAAQ,0BAAc;IAEvD,MAAM,CAAU,MAAM,GAAyC;QAC3D,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,qBAAa,CAAC;KAC9C,CAAC;;AAJN,0DAKC","sourcesContent":["import { FileLimitMode, FILE_LIMIT_MODES, ModifiedCodeMode, MODIFIED_CODE_MODES } from \"@webpieces/rules-sdk\";\nimport { BaseRuleConfig } from \"@webpieces/rules-sdk\";\nimport { FieldDef, SchemaShape } from \"@webpieces/rules-sdk\";\n// Mode const arrays — TypeScript union types derived from them, and FieldDef enum\n// values reference the same array. Impossible for the type and runtime check to diverge.\n\n// Single source of truth for rule \"mode\" values. Exported so code-rules (and any other\n// consumer) imports these instead of re-declaring the same unions — a rename here ripples\n// everywhere at compile time. The FieldDef SCHEMA below references the same arrays, so the\n// type and the runtime validation can never diverge.\nexport const METHOD_LIMIT_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'NEW_AND_MODIFIED_FILES'] as const;\n\nexport type MethodLimitMode = typeof METHOD_LIMIT_MODES[number];\n\nexport const RETURN_TYPE_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'NEW_AND_MODIFIED_FILES'] as const;\n\nexport type ReturnTypeMode = typeof RETURN_TYPE_MODES[number];\n\nexport const INLINE_TYPE_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'NEW_AND_MODIFIED_FILES'] as const;\n\nexport type InlineTypeMode = typeof INLINE_TYPE_MODES[number];\n\n// PROJECT-level rules (e.g. framework-tag): the check is neither line- nor file-scoped — it runs\n// for a whole project when ANY file the project owns is touched. `MODIFIED_PROJECTS` names that\n// honestly (nx `affected` already narrows execution to the changed projects).\nexport const PROJECT_MODES = ['OFF', 'MODIFIED_PROJECTS'] as const;\n\nexport type ProjectMode = typeof PROJECT_MODES[number];\n\nexport const PRISMA_DTOS_MODES = ['OFF', 'MODIFIED_CLASS', 'NEW_AND_MODIFIED_FILES'] as const;\n\nexport type PrismaValidateDtosMode = typeof PRISMA_DTOS_MODES[number];\n\nexport const PRISMA_CONVERTER_MODES = ['OFF', 'NEW_AND_MODIFIED_METHODS', 'NEW_AND_MODIFIED_FILES'] as const;\n\nexport type PrismaConverterMode = typeof PRISMA_CONVERTER_MODES[number];\n\nexport const DIRECT_API_RESOLVER_MODES = ['OFF', 'NEW_AND_MODIFIED_CODE', 'NEW_AND_MODIFIED_METHODS', 'NEW_AND_MODIFIED_FILES'] as const;\n\nexport type DirectApiResolverMode = typeof DIRECT_API_RESOLVER_MODES[number];\n\n// ---------------------------------------------------------------------------\n// Universal escape hatches — EVERY rule supports temporarily disabling itself\n// either while on a named git branch (turnOffRuleWhileOnBranch) or until an\n// epoch passes (turnOffRuleUntilEpoch). They live on a shared base class so the\n// fields (and their schema entries) are declared once instead of repeated per\n// rule. `mode` stays per-rule because its allowed values vary (ON/OFF vs\n// NEW_AND_MODIFIED_CODE vs NEW_AND_MODIFIED_METHODS, etc).\n//\n// BOTH fields are REQUIRED on every rule so both hatches are ALWAYS VISIBLE in the config — an AI\n// editing webpieces.config.json sees them on every rule and cannot miss that a rule can be time-boxed\n// or branch-scoped off. Convention:\n// turnOffRuleUntilEpoch: 0 = rule active (epoch in the past); a future unix epoch IN SECONDS =\n// temporarily disabled until that moment.\n// turnOffRuleWhileOnBranch: null = always on; a branch name = disabled while that branch is checked out.\n// The name is matched EXACTLY (===). Globs/wildcards are NOT supported and\n// must not be added: a pattern would switch a rule off on branches nobody\n// enumerated. It is also ignored (loudly — shouldSkipRule throws) on a pull\n// request from a FORK, where the branch name is the contributor's to choose.\n// Required-but-nullable so its \"unset\" state is present-and-visible (null)\n// rather than omitted.\n// The earlier spellings of these two fields were RENAMED to the names above and are no longer accepted —\n// the validator rejects them with a \"renamed to X\" hint. RENAMED_FIELD_ALIASES in validate-config.ts is\n// the ONE place in src/ a dead spelling may still be written (see escape-hatch-key-spelling.spec.ts).\n// ---------------------------------------------------------------------------\nexport class MaxMethodLinesConfig extends BaseRuleConfig {\n declare mode?: MethodLimitMode;\n limit?: number;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<MaxMethodLinesConfig> = {\n mode: new FieldDef('string', METHOD_LIMIT_MODES),\n limit: FieldDef.optional('number'),\n disableAllowed: FieldDef.optional('boolean'),\n };\n}\n\n// max-file-lines — caps a file's line count.\n//\n// The framework-owned `excludePaths` (every rule accepts it, the dispatcher applies it — #1253) exempts\n// whole file trees. For this rule it is for files the repo did NOT author and cannot shrink — never a\n// standing amnesty for hand-written code, which is what the inline disable and a refactor are for.\n//\n// The machine-generated trees in GENERATED_CODE_PATHS are exempt WITHOUT configuration, and\n// `excludePaths` ADDS to that floor rather than replacing it — see generated-code-paths.ts for why a\n// 42,000-line graphql-codegen output must not be able to cost a repo the whole rule.\nexport class MaxFileLinesConfig extends BaseRuleConfig {\n declare mode?: FileLimitMode;\n limit?: number;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<MaxFileLinesConfig> = {\n mode: new FieldDef('string', FILE_LIMIT_MODES),\n limit: FieldDef.optional('number'),\n disableAllowed: FieldDef.optional('boolean'),\n };\n}\n\nexport class RequireReturnTypeConfig extends BaseRuleConfig {\n declare mode?: ReturnTypeMode;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<RequireReturnTypeConfig> = {\n mode: new FieldDef('string', RETURN_TYPE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n };\n}\n\nexport class NoInlineTypeLiteralsConfig extends BaseRuleConfig {\n declare mode?: InlineTypeMode;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<NoInlineTypeLiteralsConfig> = {\n mode: new FieldDef('string', INLINE_TYPE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n };\n}\n\nexport class NoAnyUnknownConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<NoAnyUnknownConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n };\n}\n\nexport class NoImplicitAnyConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<NoImplicitAnyConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n };\n}\n\nexport class PrismaValidateDtosConfig extends BaseRuleConfig {\n declare mode?: PrismaValidateDtosMode;\n disableAllowed?: boolean;\n prismaSchemaPath?: string;\n dtoSourcePaths?: string[];\n\n static readonly SCHEMA: SchemaShape<PrismaValidateDtosConfig> = {\n mode: new FieldDef('string', PRISMA_DTOS_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n prismaSchemaPath: FieldDef.optional('string'),\n dtoSourcePaths: FieldDef.optional('string[]'),\n };\n}\n\nexport class PrismaConverterConfig extends BaseRuleConfig {\n declare mode?: PrismaConverterMode;\n disableAllowed?: boolean;\n schemaPath?: string;\n convertersPaths?: string[];\n enforcePaths?: string[];\n\n static readonly SCHEMA: SchemaShape<PrismaConverterConfig> = {\n mode: new FieldDef('string', PRISMA_CONVERTER_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n schemaPath: FieldDef.optional('string'),\n convertersPaths: FieldDef.optional('string[]'),\n enforcePaths: FieldDef.optional('string[]'),\n };\n}\n\n// The framework-owned `excludePaths` exempts whole file trees whose idioms are destructuring by\n// construction (React / React Native components and hooks — `const [x, setX] = useState()`, destructured\n// props — framework glue). It is the ONLY escape when `disableAllowed: false`, since that setting\n// deliberately ignores inline disables.\nexport class NoDestructureConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n allowTopLevel?: boolean;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<NoDestructureConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n allowTopLevel: FieldDef.optional('boolean'),\n disableAllowed: FieldDef.optional('boolean'),\n };\n}\n\nexport class NoUnmanagedExceptionsConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<NoUnmanagedExceptionsConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n };\n}\n\nexport class CatchErrorPatternConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<CatchErrorPatternConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n };\n}\n\nexport class AngularNoDirectApiInResolverConfig extends BaseRuleConfig {\n declare mode?: DirectApiResolverMode;\n disableAllowed?: boolean;\n enforcePaths?: string[];\n\n static readonly SCHEMA: SchemaShape<AngularNoDirectApiInResolverConfig> = {\n mode: new FieldDef('string', DIRECT_API_RESOLVER_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n enforcePaths: FieldDef.optional('string[]'),\n };\n}\n\n// Bans hand-written CSS in Angular sources (styles:/styleUrls:/styleUrl: in @Component, and inline\n// style=/[style.x]/[ngStyle] in templates) so teams style with Tailwind utility classes. `allowGlobs`\n// exempts paths WITHIN the Angular scope (e.g. a vendored Fuse kit copied verbatim with its own CSS).\nexport class NoCustomCssConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n allowGlobs?: string[];\n\n static readonly SCHEMA: SchemaShape<NoCustomCssConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n allowGlobs: FieldDef.optional('string[]'),\n };\n}\n\nexport class NoSymbolDiTokensConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<NoSymbolDiTokensConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n };\n}\n\n// Flags `process.exit(...)` outside a main()/runMain wrapper (and `import { main }`) so a deep exit\n// can't silently kill a reused server/command. Gradual-rollout knobs via the standard base: mode\n// (OFF | NEW_AND_MODIFIED_CODE | NEW_AND_MODIFIED_FILES), turnOffRuleUntilEpoch, branch, and\n// disableAllowed for the inline `// webpieces-disable` escape at genuine terminal boundaries.\nexport class NoProcessExitOutsideMainConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<NoProcessExitOutsideMainConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n };\n}\n\n// Flags a function CREATED OUTSIDE A CLASS at module scope: a top-level `function foo()` declaration\n// or a top-level `const foo = () => {}` / `= function(){}`. The point is that webpieces DI +\n// @DocumentDesign only work when behavior lives in injectable classes — a module-scope function is a\n// dead-end the DI graph can't reach. Inline callbacks, nested functions inside methods, and non-function\n// top-level consts (objects, zod schemas, primitives) are NOT flagged. Standard rollout knobs via the\n// base: mode (OFF | NEW_AND_MODIFIED_CODE | NEW_AND_MODIFIED_FILES), turnOffRuleUntilEpoch, branch,\n// and disableAllowed for the inline `// webpieces-disable` escape. The framework-owned `excludePaths`\n// exempts whole file trees that legitimately live outside the class-per-behavior model (e.g. React\n// component/hook files, framework glue).\nexport class NoFunctionOutsideClassConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<NoFunctionOutsideClassConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n };\n}\n\n// inject-annotation-not-needed-for-concrete-class — flags a REDUNDANT `@inject(X)` whose token is\n// textually identical to the parameter's own declared type (`@inject(Foo) private readonly foo: Foo`).\n// In this inversify setup the decorator is pure noise there: reflect-metadata (emitDecoratorMetadata)\n// already resolves a constructor parameter by its class type, so `private readonly foo: Foo` binds on\n// its own (see CLAUDE.md, and the no-symbol-di-tokens rule that pushes the same way). Symbol/interface\n// tokens are NOT flagged because they never equal the type (`@inject(FOO_TOKEN) x: Provider<Foo>`).\n// AI keeps carpet-bombing `@inject`; this fails the build on the redundant form. Standard rollout knobs\n// via the base: mode (OFF | NEW_AND_MODIFIED_CODE | NEW_AND_MODIFIED_FILES), turnOffRuleUntilEpoch,\n// branch, and disableAllowed for the inline `// webpieces-disable` escape. The framework-owned\n// `excludePaths` exempts whole file trees.\nexport class InjectAnnotationNotNeededForConcreteClassConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<InjectAnnotationNotNeededForConcreteClassConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n };\n}\n\n// framework-tag — every project that a changed source file belongs to must carry >=1\n// `framework:<browser|react|angular|node|express|react-native>` nx tag in its project.json. Those tags are the\n// project's \"libType\" — the SET of runtime environments it runs in — and the source of truth for\n// the dependencies.json `framework` field and the `library-types-match-client` rule. Multiple tags\n// are allowed (the env set) and values are validated against the known set (`framework:all` is a\n// hard error). `knownTypes` customizes that set (defaults to browser, react, angular, node, express,\n// react-native — the last a first-class runtime, not a browser, #1064).\nexport class FrameworkTagConfig extends BaseRuleConfig {\n declare mode?: ProjectMode;\n knownTypes?: string[];\n\n static readonly SCHEMA: SchemaShape<FrameworkTagConfig> = {\n mode: new FieldDef('string', PROJECT_MODES),\n knownTypes: FieldDef.optional('string[]'),\n };\n}\n\n// role-tag — every project that a changed source file belongs to must carry a\n// `role:<server|app|bundle|designed-lib|lib|client|api-lib|api-client>` nx tag in its project.json. That tag is the project's\n// ROLE (orthogonal to `framework` libType) — the source of truth for the dependencies.json `role`\n// field, the `role-dependency` edge rule (apps are never depended upon), and DI-design generation\n// (server→@Controller, designed-lib→@ApiImplementation, lib→none, client→angular design).\n// `knownTypes` customizes the list suggested to the author when a tag is missing.\nexport class RoleTagConfig extends BaseRuleConfig {\n declare mode?: ProjectMode;\n knownTypes?: string[];\n\n static readonly SCHEMA: SchemaShape<RoleTagConfig> = {\n mode: new FieldDef('string', PROJECT_MODES),\n knownTypes: FieldDef.optional('string[]'),\n };\n}\n\n// Touching a project audits every production API contract it directly owns.\nexport class EnsureWeAreSecureConfig extends BaseRuleConfig {\n declare mode?: ProjectMode;\n static readonly SCHEMA: SchemaShape<EnsureWeAreSecureConfig> = {\n mode: new FieldDef('string', PROJECT_MODES),\n };\n}\n"]}
@@ -32,7 +32,8 @@ export type ProjectScanMode = typeof PROJECT_SCAN_MODES[number];
32
32
  * installed `@types/*`, so it counts as including `node`. Both must therefore be stated.
33
33
  *
34
34
  * - `mode` — OFF | MODIFIED_PROJECTS | RUN_EVERY_TIME.
35
- * - `allowedPaths` — optional globs over project roots this rule skips.
35
+ * - `allowedPaths` — optional globs over PROJECT ROOTS this rule skips (a project, not a file: the
36
+ * framework-owned `excludePaths` filters files, this filters whole projects by their root).
36
37
  */
37
38
  export declare class FrameworkTsconfigConfig extends BaseRuleConfig {
38
39
  mode?: ProjectScanMode;
@@ -57,7 +58,8 @@ export declare class FrameworkPackagesEntry {
57
58
  *
58
59
  * - `mode` — OFF | MODIFIED_PROJECTS | RUN_EVERY_TIME.
59
60
  * - `entries` — required, non-empty. The recommended list is in `.claude/rules/framework-tags.md`.
60
- * - `allowedPaths` — optional globs over project roots this rule skips.
61
+ * - `allowedPaths` — optional globs over PROJECT ROOTS this rule skips (a project, not a file: the
62
+ * framework-owned `excludePaths` filters files, this filters whole projects by their root).
61
63
  */
62
64
  export declare class FrameworkPackagesConfig extends BaseRuleConfig {
63
65
  mode?: ProjectScanMode;
@@ -34,14 +34,14 @@ exports.PROJECT_SCAN_MODES = ['OFF', 'MODIFIED_PROJECTS', 'RUN_EVERY_TIME'];
34
34
  * installed `@types/*`, so it counts as including `node`. Both must therefore be stated.
35
35
  *
36
36
  * - `mode` — OFF | MODIFIED_PROJECTS | RUN_EVERY_TIME.
37
- * - `allowedPaths` — optional globs over project roots this rule skips.
37
+ * - `allowedPaths` — optional globs over PROJECT ROOTS this rule skips (a project, not a file: the
38
+ * framework-owned `excludePaths` filters files, this filters whole projects by their root).
38
39
  */
39
40
  class FrameworkTsconfigConfig extends rules_sdk_1.BaseRuleConfig {
40
41
  allowedPaths;
41
42
  static SCHEMA = {
42
43
  mode: new rules_sdk_1.FieldDef('string', exports.PROJECT_SCAN_MODES),
43
44
  allowedPaths: rules_sdk_1.FieldDef.optional('string[]'),
44
- ...rules_sdk_1.BASE_RULE_SCHEMA,
45
45
  };
46
46
  }
47
47
  exports.FrameworkTsconfigConfig = FrameworkTsconfigConfig;
@@ -67,7 +67,8 @@ exports.FrameworkPackagesEntry = FrameworkPackagesEntry;
67
67
  *
68
68
  * - `mode` — OFF | MODIFIED_PROJECTS | RUN_EVERY_TIME.
69
69
  * - `entries` — required, non-empty. The recommended list is in `.claude/rules/framework-tags.md`.
70
- * - `allowedPaths` — optional globs over project roots this rule skips.
70
+ * - `allowedPaths` — optional globs over PROJECT ROOTS this rule skips (a project, not a file: the
71
+ * framework-owned `excludePaths` filters files, this filters whole projects by their root).
71
72
  */
72
73
  class FrameworkPackagesConfig extends rules_sdk_1.BaseRuleConfig {
73
74
  entries;
@@ -76,7 +77,6 @@ class FrameworkPackagesConfig extends rules_sdk_1.BaseRuleConfig {
76
77
  mode: new rules_sdk_1.FieldDef('string', exports.PROJECT_SCAN_MODES),
77
78
  entries: rules_sdk_1.FieldDef.nonEmptyObjects(FrameworkPackagesEntry.SCHEMA),
78
79
  allowedPaths: rules_sdk_1.FieldDef.optional('string[]'),
79
- ...rules_sdk_1.BASE_RULE_SCHEMA,
80
80
  };
81
81
  }
82
82
  exports.FrameworkPackagesConfig = FrameworkPackagesConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"tag-truth-configs.js","sourceRoot":"","sources":["../../../../../../packages/tooling/code-rules/src/configs/tag-truth-configs.ts"],"names":[],"mappings":";;;AAAA,oDAA+F;AAC/F;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AACU,QAAA,kBAAkB,GAAG,CAAC,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,CAAU,CAAC;AAI1F;;;;;;;;;;;;GAYG;AACH,MAAa,uBAAwB,SAAQ,0BAAc;IAEvD,YAAY,CAAY;IAExB,MAAM,CAAU,MAAM,GAAyC;QAC3D,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,0BAAkB,CAAC;QAChD,YAAY,EAAE,oBAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC3C,GAAG,4BAAgB;KACtB,CAAC;;AARN,0DASC;AAED,2EAA2E;AAC3E,MAAa,sBAAsB;IAC/B,oGAAoG;IACpG,QAAQ,CAAY;IACpB,gFAAgF;IAChF,UAAU,CAAY;IAEtB,MAAM,CAAU,MAAM,GAAwC;QAC1D,QAAQ,EAAE,oBAAQ,CAAC,eAAe,EAAE;QACpC,UAAU,EAAE,oBAAQ,CAAC,eAAe,EAAE;KACzC,CAAC;;AATN,wDAUC;AAED;;;;;;;;;;;GAWG;AACH,MAAa,uBAAwB,SAAQ,0BAAc;IAEvD,OAAO,CAA4B;IACnC,YAAY,CAAY;IAExB,MAAM,CAAU,MAAM,GAAyC;QAC3D,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,0BAAkB,CAAC;QAChD,OAAO,EAAE,oBAAQ,CAAC,eAAe,CAAC,sBAAsB,CAAC,MAAM,CAAC;QAChE,YAAY,EAAE,oBAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC3C,GAAG,4BAAgB;KACtB,CAAC;;AAVN,0DAWC","sourcesContent":["import { FieldDef, SchemaShape, BaseRuleConfig, BASE_RULE_SCHEMA } from \"@webpieces/rules-sdk\";\n/**\n * The six rules that make an nx `framework:*` / `role:*` / `product:*` tag TRUE (#1064, #1179). Before\n * them a tag was a promise only the dependency graph checked; the code inside a library, the folder it\n * lives in and the packages it imports were never compared with it.\n *\n * Four are GRAPH rules (they read the whole nx project graph, so they run in `architecture:generate`\n * and `validate-architecture-unchanged` beside `library-types-match-client`): `api-lib-dependencies`,\n * `api-lib-path`, `framework-folder` and `product-tags` (every server, client and app names its\n * product, and every dependency edge respects the product dependency matrix), all owned by `@webpieces/nx-webpieces-rules`. Two are PROJECT rules in `@webpieces/code-rules`:\n * `framework-tsconfig` and `framework-packages`.\n *\n * Every field that decides behaviour is REQUIRED with no default (`.claude/rules/no-rule-defaults.md`):\n * which packages an api library may import, which folders hold which runtimes, and which framework\n * packages belong to which runtime are the CONSUMER's layout, never webpieces'. The recommended values\n * are SEEDED into a fresh config (seed-entry.ts) and documented in `.claude/rules/framework-tags.md`.\n */\n\n/**\n * The modes of the two PROJECT rules: OFF, MODIFIED_PROJECTS (every project owning a changed file) or\n * RUN_EVERY_TIME (every project in the repo — the migration sweep).\n */\nexport const PROJECT_SCAN_MODES = ['OFF', 'MODIFIED_PROJECTS', 'RUN_EVERY_TIME'] as const;\n\nexport type ProjectScanMode = typeof PROJECT_SCAN_MODES[number];\n\n/**\n * `framework-tsconfig` (D7) — the COMPILER enforces the runtime a library's framework tags promise. Its\n * `tsconfig.lib.json` (with everything it `extends`) must resolve to:\n * - every env a browser one (browser / angular / react): `lib` includes `dom`, `types` excludes `node`;\n * - every env a node one (node / express): `lib` excludes `dom`, `types` includes `node`;\n * - anything else (universal, browser + react-native, react-native): `lib` excludes `dom`, `types`\n * excludes `node` — pure TypeScript.\n * An unset `lib` resolves to TypeScript's default, which includes `dom`; an unset `types` includes every\n * installed `@types/*`, so it counts as including `node`. Both must therefore be stated.\n *\n * - `mode` — OFF | MODIFIED_PROJECTS | RUN_EVERY_TIME.\n * - `allowedPaths` — optional globs over project roots this rule skips.\n */\nexport class FrameworkTsconfigConfig extends BaseRuleConfig {\n declare mode?: ProjectScanMode;\n allowedPaths?: string[];\n\n static readonly SCHEMA: SchemaShape<FrameworkTsconfigConfig> = {\n mode: new FieldDef('string', PROJECT_SCAN_MODES),\n allowedPaths: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\n/** Framework packages and the runtimes that may import them. Data-only. */\nexport class FrameworkPackagesEntry {\n /** Package-name globs, e.g. `[\"@angular/*\"]` or `[\"react\", \"react-native\", \"expo*\"]`. Non-empty. */\n packages!: string[];\n /** The framework tags allowed to import them, e.g. `[\"angular\"]`. Non-empty. */\n frameworks!: string[];\n\n static readonly SCHEMA: SchemaShape<FrameworkPackagesEntry> = {\n packages: FieldDef.nonEmptyStrings(),\n frameworks: FieldDef.nonEmptyStrings(),\n };\n}\n\n/**\n * `framework-packages` (D8) — a framework package is imported only by a project whose EVERY framework\n * tag is one its entry allows. A `browser+node` library importing `firebase-admin` is refused (its\n * browser env cannot run it); a `react` library importing `react` is not.\n *\n * Only production source is read (specs and test setup are not the runtime). A package no entry names\n * is not judged.\n *\n * - `mode` — OFF | MODIFIED_PROJECTS | RUN_EVERY_TIME.\n * - `entries` — required, non-empty. The recommended list is in `.claude/rules/framework-tags.md`.\n * - `allowedPaths` — optional globs over project roots this rule skips.\n */\nexport class FrameworkPackagesConfig extends BaseRuleConfig {\n declare mode?: ProjectScanMode;\n entries!: FrameworkPackagesEntry[];\n allowedPaths?: string[];\n\n static readonly SCHEMA: SchemaShape<FrameworkPackagesConfig> = {\n mode: new FieldDef('string', PROJECT_SCAN_MODES),\n entries: FieldDef.nonEmptyObjects(FrameworkPackagesEntry.SCHEMA),\n allowedPaths: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n"]}
1
+ {"version":3,"file":"tag-truth-configs.js","sourceRoot":"","sources":["../../../../../../packages/tooling/code-rules/src/configs/tag-truth-configs.ts"],"names":[],"mappings":";;;AAAA,oDAA6E;AAC7E;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AACU,QAAA,kBAAkB,GAAG,CAAC,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,CAAU,CAAC;AAI1F;;;;;;;;;;;;;GAaG;AACH,MAAa,uBAAwB,SAAQ,0BAAc;IAEvD,YAAY,CAAY;IAExB,MAAM,CAAU,MAAM,GAAyC;QAC3D,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,0BAAkB,CAAC;QAChD,YAAY,EAAE,oBAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;KAC9C,CAAC;;AAPN,0DAQC;AAED,2EAA2E;AAC3E,MAAa,sBAAsB;IAC/B,oGAAoG;IACpG,QAAQ,CAAY;IACpB,gFAAgF;IAChF,UAAU,CAAY;IAEtB,MAAM,CAAU,MAAM,GAAwC;QAC1D,QAAQ,EAAE,oBAAQ,CAAC,eAAe,EAAE;QACpC,UAAU,EAAE,oBAAQ,CAAC,eAAe,EAAE;KACzC,CAAC;;AATN,wDAUC;AAED;;;;;;;;;;;;GAYG;AACH,MAAa,uBAAwB,SAAQ,0BAAc;IAEvD,OAAO,CAA4B;IACnC,YAAY,CAAY;IAExB,MAAM,CAAU,MAAM,GAAyC;QAC3D,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,0BAAkB,CAAC;QAChD,OAAO,EAAE,oBAAQ,CAAC,eAAe,CAAC,sBAAsB,CAAC,MAAM,CAAC;QAChE,YAAY,EAAE,oBAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;KAC9C,CAAC;;AATN,0DAUC","sourcesContent":["import { FieldDef, SchemaShape, BaseRuleConfig } from \"@webpieces/rules-sdk\";\n/**\n * The six rules that make an nx `framework:*` / `role:*` / `product:*` tag TRUE (#1064, #1179). Before\n * them a tag was a promise only the dependency graph checked; the code inside a library, the folder it\n * lives in and the packages it imports were never compared with it.\n *\n * Four are GRAPH rules (they read the whole nx project graph, so they run in `architecture:generate`\n * and `validate-architecture-unchanged` beside `library-types-match-client`): `api-lib-dependencies`,\n * `api-lib-path`, `framework-folder` and `product-tags` (every server, client and app names its\n * product, and every dependency edge respects the product dependency matrix), all owned by `@webpieces/nx-webpieces-rules`. Two are PROJECT rules in `@webpieces/code-rules`:\n * `framework-tsconfig` and `framework-packages`.\n *\n * Every field that decides behaviour is REQUIRED with no default (`.claude/rules/no-rule-defaults.md`):\n * which packages an api library may import, which folders hold which runtimes, and which framework\n * packages belong to which runtime are the CONSUMER's layout, never webpieces'. The recommended values\n * are SEEDED into a fresh config (seed-entry.ts) and documented in `.claude/rules/framework-tags.md`.\n */\n\n/**\n * The modes of the two PROJECT rules: OFF, MODIFIED_PROJECTS (every project owning a changed file) or\n * RUN_EVERY_TIME (every project in the repo — the migration sweep).\n */\nexport const PROJECT_SCAN_MODES = ['OFF', 'MODIFIED_PROJECTS', 'RUN_EVERY_TIME'] as const;\n\nexport type ProjectScanMode = typeof PROJECT_SCAN_MODES[number];\n\n/**\n * `framework-tsconfig` (D7) — the COMPILER enforces the runtime a library's framework tags promise. Its\n * `tsconfig.lib.json` (with everything it `extends`) must resolve to:\n * - every env a browser one (browser / angular / react): `lib` includes `dom`, `types` excludes `node`;\n * - every env a node one (node / express): `lib` excludes `dom`, `types` includes `node`;\n * - anything else (universal, browser + react-native, react-native): `lib` excludes `dom`, `types`\n * excludes `node` — pure TypeScript.\n * An unset `lib` resolves to TypeScript's default, which includes `dom`; an unset `types` includes every\n * installed `@types/*`, so it counts as including `node`. Both must therefore be stated.\n *\n * - `mode` — OFF | MODIFIED_PROJECTS | RUN_EVERY_TIME.\n * - `allowedPaths` — optional globs over PROJECT ROOTS this rule skips (a project, not a file: the\n * framework-owned `excludePaths` filters files, this filters whole projects by their root).\n */\nexport class FrameworkTsconfigConfig extends BaseRuleConfig {\n declare mode?: ProjectScanMode;\n allowedPaths?: string[];\n\n static readonly SCHEMA: SchemaShape<FrameworkTsconfigConfig> = {\n mode: new FieldDef('string', PROJECT_SCAN_MODES),\n allowedPaths: FieldDef.optional('string[]'),\n };\n}\n\n/** Framework packages and the runtimes that may import them. Data-only. */\nexport class FrameworkPackagesEntry {\n /** Package-name globs, e.g. `[\"@angular/*\"]` or `[\"react\", \"react-native\", \"expo*\"]`. Non-empty. */\n packages!: string[];\n /** The framework tags allowed to import them, e.g. `[\"angular\"]`. Non-empty. */\n frameworks!: string[];\n\n static readonly SCHEMA: SchemaShape<FrameworkPackagesEntry> = {\n packages: FieldDef.nonEmptyStrings(),\n frameworks: FieldDef.nonEmptyStrings(),\n };\n}\n\n/**\n * `framework-packages` (D8) — a framework package is imported only by a project whose EVERY framework\n * tag is one its entry allows. A `browser+node` library importing `firebase-admin` is refused (its\n * browser env cannot run it); a `react` library importing `react` is not.\n *\n * Only production source is read (specs and test setup are not the runtime). A package no entry names\n * is not judged.\n *\n * - `mode` — OFF | MODIFIED_PROJECTS | RUN_EVERY_TIME.\n * - `entries` — required, non-empty. The recommended list is in `.claude/rules/framework-tags.md`.\n * - `allowedPaths` — optional globs over PROJECT ROOTS this rule skips (a project, not a file: the\n * framework-owned `excludePaths` filters files, this filters whole projects by their root).\n */\nexport class FrameworkPackagesConfig extends BaseRuleConfig {\n declare mode?: ProjectScanMode;\n entries!: FrameworkPackagesEntry[];\n allowedPaths?: string[];\n\n static readonly SCHEMA: SchemaShape<FrameworkPackagesConfig> = {\n mode: new FieldDef('string', PROJECT_SCAN_MODES),\n entries: FieldDef.nonEmptyObjects(FrameworkPackagesEntry.SCHEMA),\n allowedPaths: FieldDef.optional('string[]'),\n };\n}\n"]}
package/src/index.d.ts CHANGED
@@ -36,6 +36,7 @@ export { default as validateCode } from './validate-code';
36
36
  export { CodeRulesBootstrap } from './code-rules-bootstrap';
37
37
  export { CodeRulesRunRequest, RuleSelection, RunRequestParser } from './code-rules-run-request';
38
38
  export { ScanScope, GateScanScope, ScanRestriction, ProjectCatalog, ProjectEntry, RecordedSite } from './scan-scope';
39
+ export { ExclusionScopedPolicy, GlobalExcludePaths, RuleExclusionsFactory } from './rule-dispatch';
39
40
  export { ReactNativeCompatibility } from './react-native-compatibility';
40
41
  export { METHOD_LIMIT_MODES, RETURN_TYPE_MODES, INLINE_TYPE_MODES, PROJECT_MODES, PRISMA_DTOS_MODES, PRISMA_CONVERTER_MODES, DIRECT_API_RESOLVER_MODES, MaxMethodLinesConfig, MaxFileLinesConfig, RequireReturnTypeConfig, NoInlineTypeLiteralsConfig, NoAnyUnknownConfig, NoImplicitAnyConfig, PrismaValidateDtosConfig, PrismaConverterConfig, NoDestructureConfig, NoUnmanagedExceptionsConfig, CatchErrorPatternConfig, AngularNoDirectApiInResolverConfig, NoCustomCssConfig, NoSymbolDiTokensConfig, NoProcessExitOutsideMainConfig, NoFunctionOutsideClassConfig, InjectAnnotationNotNeededForConcreteClassConfig, FrameworkTagConfig, RoleTagConfig, EnsureWeAreSecureConfig } from './configs/rule-configs';
41
42
  export type { MethodLimitMode, ReturnTypeMode, InlineTypeMode, ProjectMode, PrismaValidateDtosMode, PrismaConverterMode, DirectApiResolverMode } from './configs/rule-configs';
package/src/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.frameworkTsconfigError = exports.TsconfigRuntimeViolation = exports.RuntimeCompilerOptions = exports.FrameworkTsconfigAudit = exports.FrameworkTsconfigValidator = exports.ScannedProject = exports.ProjectScanTargets = exports.ApiLibEnumIndex = exports.GoverningGlob = exports.SuffixRename = exports.SuffixEntryPicker = exports.ExportedTypeScanner = exports.RequiredTypeSuffixValidator = exports.UtilityTypeScanner = exports.NoUtilityTypesInApiLibValidator = exports.EnumSpellingScanner = exports.OneEnumSpellingInApiLibValidator = exports.InlineImportScanner = exports.NoInlineImportInApiLibValidator = exports.ApiLibSite = exports.ApiLibFile = exports.findDirectlyChangedProjectRoots = exports.auditSecurityContracts = exports.SecurityContractViolation = exports.EnsureWeAreSecureValidator = exports.RoleTagValidator = exports.FrameworkTagValidator = exports.findRedundantInjectInSource = exports.InjectAnnotationNotNeededForConcreteClassValidator = exports.NoFunctionOutsideClassValidator = exports.NoProcessExitOutsideMainValidator = exports.ProjectRoleResolver = exports.StatePathViolation = exports.StatePathHit = exports.NoStatePathsInTemplatesValidator = exports.NoClientCreationOutsideServerOrClientValidator = exports.NoSymbolDiTokensValidator = exports.NoDirectApiResolverValidator = exports.NoDestructureValidator = exports.NoUnmanagedExceptionsValidator = exports.CatchErrorPatternValidator = exports.NoInlineTypeLiteralsValidator = exports.RequireReturnTypeValidator = exports.MaxFileLinesValidator = exports.runNewMethods = exports.runModifiedMethods = exports.MaxMethodLinesValidator = exports.NoImplicitAnyValidator = exports.NoAnyUnknownValidator = exports.CodeValidator = void 0;
4
- exports.DEFAULT_BANNED_STATE_PATH_PREFIXES = exports.DEFAULT_TEMPLATE_DIRS = exports.NoClientCreationOutsideServerOrClientConfig = exports.CLIENT_CREATION_SEVERITIES = exports.EnsureWeAreSecureConfig = exports.RoleTagConfig = exports.FrameworkTagConfig = exports.InjectAnnotationNotNeededForConcreteClassConfig = exports.NoFunctionOutsideClassConfig = exports.NoProcessExitOutsideMainConfig = exports.NoSymbolDiTokensConfig = exports.NoCustomCssConfig = exports.AngularNoDirectApiInResolverConfig = exports.CatchErrorPatternConfig = exports.NoUnmanagedExceptionsConfig = exports.NoDestructureConfig = exports.PrismaConverterConfig = exports.PrismaValidateDtosConfig = exports.NoImplicitAnyConfig = exports.NoAnyUnknownConfig = exports.NoInlineTypeLiteralsConfig = exports.RequireReturnTypeConfig = exports.MaxFileLinesConfig = exports.MaxMethodLinesConfig = exports.DIRECT_API_RESOLVER_MODES = exports.PRISMA_CONVERTER_MODES = exports.PRISMA_DTOS_MODES = exports.PROJECT_MODES = exports.INLINE_TYPE_MODES = exports.RETURN_TYPE_MODES = exports.METHOD_LIMIT_MODES = exports.ReactNativeCompatibility = exports.RecordedSite = exports.ProjectEntry = exports.ProjectCatalog = exports.ScanRestriction = exports.GateScanScope = exports.ScanScope = exports.RunRequestParser = exports.RuleSelection = exports.CodeRulesRunRequest = exports.CodeRulesBootstrap = exports.validateCode = exports.PrismaConverterValidator = exports.PrismaValidateDtosValidator = exports.EnumText = exports.frameworkPackagesError = exports.FrameworkPackageViolation = exports.FrameworkPackagesAudit = exports.FrameworkPackagesValidator = void 0;
5
- exports.FrameworkPackagesConfig = exports.FrameworkPackagesEntry = exports.FrameworkTsconfigConfig = exports.PROJECT_SCAN_MODES = exports.RequiredTypeSuffixConfig = exports.RequiredTypeSuffixEntry = exports.NoUtilityTypesInApiLibConfig = exports.OneEnumSpellingInApiLibConfig = exports.NoInlineImportInApiLibConfig = exports.NoStatePathsInTemplatesConfig = void 0;
4
+ exports.CLIENT_CREATION_SEVERITIES = exports.EnsureWeAreSecureConfig = exports.RoleTagConfig = exports.FrameworkTagConfig = exports.InjectAnnotationNotNeededForConcreteClassConfig = exports.NoFunctionOutsideClassConfig = exports.NoProcessExitOutsideMainConfig = exports.NoSymbolDiTokensConfig = exports.NoCustomCssConfig = exports.AngularNoDirectApiInResolverConfig = exports.CatchErrorPatternConfig = exports.NoUnmanagedExceptionsConfig = exports.NoDestructureConfig = exports.PrismaConverterConfig = exports.PrismaValidateDtosConfig = exports.NoImplicitAnyConfig = exports.NoAnyUnknownConfig = exports.NoInlineTypeLiteralsConfig = exports.RequireReturnTypeConfig = exports.MaxFileLinesConfig = exports.MaxMethodLinesConfig = exports.DIRECT_API_RESOLVER_MODES = exports.PRISMA_CONVERTER_MODES = exports.PRISMA_DTOS_MODES = exports.PROJECT_MODES = exports.INLINE_TYPE_MODES = exports.RETURN_TYPE_MODES = exports.METHOD_LIMIT_MODES = exports.ReactNativeCompatibility = exports.RuleExclusionsFactory = exports.GlobalExcludePaths = exports.ExclusionScopedPolicy = exports.RecordedSite = exports.ProjectEntry = exports.ProjectCatalog = exports.ScanRestriction = exports.GateScanScope = exports.ScanScope = exports.RunRequestParser = exports.RuleSelection = exports.CodeRulesRunRequest = exports.CodeRulesBootstrap = exports.validateCode = exports.PrismaConverterValidator = exports.PrismaValidateDtosValidator = exports.EnumText = exports.frameworkPackagesError = exports.FrameworkPackageViolation = exports.FrameworkPackagesAudit = exports.FrameworkPackagesValidator = void 0;
5
+ exports.FrameworkPackagesConfig = exports.FrameworkPackagesEntry = exports.FrameworkTsconfigConfig = exports.PROJECT_SCAN_MODES = exports.RequiredTypeSuffixConfig = exports.RequiredTypeSuffixEntry = exports.NoUtilityTypesInApiLibConfig = exports.OneEnumSpellingInApiLibConfig = exports.NoInlineImportInApiLibConfig = exports.NoStatePathsInTemplatesConfig = exports.DEFAULT_BANNED_STATE_PATH_PREFIXES = exports.DEFAULT_TEMPLATE_DIRS = exports.NoClientCreationOutsideServerOrClientConfig = void 0;
6
6
  const tslib_1 = require("tslib");
7
7
  var code_validator_1 = require("./code-validator");
8
8
  Object.defineProperty(exports, "CodeValidator", { enumerable: true, get: function () { return code_validator_1.CodeValidator; } });
@@ -110,6 +110,11 @@ Object.defineProperty(exports, "ScanRestriction", { enumerable: true, get: funct
110
110
  Object.defineProperty(exports, "ProjectCatalog", { enumerable: true, get: function () { return scan_scope_1.ProjectCatalog; } });
111
111
  Object.defineProperty(exports, "ProjectEntry", { enumerable: true, get: function () { return scan_scope_1.ProjectEntry; } });
112
112
  Object.defineProperty(exports, "RecordedSite", { enumerable: true, get: function () { return scan_scope_1.RecordedSite; } });
113
+ // Where code-rules applies the framework-owned path exclusions to every rule it composes (#1253).
114
+ var rule_dispatch_1 = require("./rule-dispatch");
115
+ Object.defineProperty(exports, "ExclusionScopedPolicy", { enumerable: true, get: function () { return rule_dispatch_1.ExclusionScopedPolicy; } });
116
+ Object.defineProperty(exports, "GlobalExcludePaths", { enumerable: true, get: function () { return rule_dispatch_1.GlobalExcludePaths; } });
117
+ Object.defineProperty(exports, "RuleExclusionsFactory", { enumerable: true, get: function () { return rule_dispatch_1.RuleExclusionsFactory; } });
113
118
  var react_native_compatibility_1 = require("./react-native-compatibility");
114
119
  Object.defineProperty(exports, "ReactNativeCompatibility", { enumerable: true, get: function () { return react_native_compatibility_1.ReactNativeCompatibility; } });
115
120
  var rule_configs_1 = require("./configs/rule-configs");