@webpieces/rules-config 0.4.843 → 0.4.845

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 (85) hide show
  1. package/package.json +9 -4
  2. package/src/WebpiecesRulesConfig.d.ts +3 -49
  3. package/src/WebpiecesRulesConfig.js +1 -44
  4. package/src/WebpiecesRulesConfig.js.map +1 -1
  5. package/src/abstract-rule.d.ts +1 -1
  6. package/src/abstract-rule.js.map +1 -1
  7. package/src/config-pruner.d.ts +3 -1
  8. package/src/config-pruner.js +13 -9
  9. package/src/config-pruner.js.map +1 -1
  10. package/src/constants.d.ts +0 -37
  11. package/src/constants.js +1 -38
  12. package/src/constants.js.map +1 -1
  13. package/src/index.d.ts +7 -24
  14. package/src/index.js +14 -105
  15. package/src/index.js.map +1 -1
  16. package/src/load-config.d.ts +6 -2
  17. package/src/load-config.js +17 -11
  18. package/src/load-config.js.map +1 -1
  19. package/src/match-rules-config.d.ts +2 -1
  20. package/src/match-rules-config.js +2 -2
  21. package/src/match-rules-config.js.map +1 -1
  22. package/src/no-custom-css-scope.d.ts +9 -25
  23. package/src/no-custom-css-scope.js +10 -24
  24. package/src/no-custom-css-scope.js.map +1 -1
  25. package/src/retired-config-keys.d.ts +3 -64
  26. package/src/retired-config-keys.js +14 -152
  27. package/src/retired-config-keys.js.map +1 -1
  28. package/src/rule-pack-registry.d.ts +41 -0
  29. package/src/rule-pack-registry.js +231 -0
  30. package/src/rule-pack-registry.js.map +1 -0
  31. package/src/rule-pack-selection.d.ts +6 -0
  32. package/src/rule-pack-selection.js +50 -0
  33. package/src/rule-pack-selection.js.map +1 -0
  34. package/src/rule-schemas.d.ts +4 -14
  35. package/src/rule-schemas.js +6 -92
  36. package/src/rule-schemas.js.map +1 -1
  37. package/src/sections.d.ts +5 -46
  38. package/src/sections.js +5 -56
  39. package/src/sections.js.map +1 -1
  40. package/src/seed-entry.d.ts +5 -16
  41. package/src/seed-entry.js +14 -141
  42. package/src/seed-entry.js.map +1 -1
  43. package/src/validate-config.d.ts +3 -2
  44. package/src/validate-config.js +62 -73
  45. package/src/validate-config.js.map +1 -1
  46. package/templates/webpieces.branch-state-matrix.md +1 -1
  47. package/src/api-doc-rules-config.d.ts +0 -60
  48. package/src/api-doc-rules-config.js +0 -71
  49. package/src/api-doc-rules-config.js.map +0 -1
  50. package/src/api-lib-spelling-configs.d.ts +0 -40
  51. package/src/api-lib-spelling-configs.js +0 -52
  52. package/src/api-lib-spelling-configs.js.map +0 -1
  53. package/src/default-rules.d.ts +0 -2
  54. package/src/default-rules.js +0 -119
  55. package/src/default-rules.js.map +0 -1
  56. package/src/field-def.d.ts +0 -24
  57. package/src/field-def.js +0 -59
  58. package/src/field-def.js.map +0 -1
  59. package/src/main-sync-guard-configs.d.ts +0 -38
  60. package/src/main-sync-guard-configs.js +0 -54
  61. package/src/main-sync-guard-configs.js.map +0 -1
  62. package/src/no-client-creation-config.d.ts +0 -12
  63. package/src/no-client-creation-config.js +0 -40
  64. package/src/no-client-creation-config.js.map +0 -1
  65. package/src/no-root-union-config.d.ts +0 -25
  66. package/src/no-root-union-config.js +0 -33
  67. package/src/no-root-union-config.js.map +0 -1
  68. package/src/no-state-paths-config.d.ts +0 -41
  69. package/src/no-state-paths-config.js +0 -51
  70. package/src/no-state-paths-config.js.map +0 -1
  71. package/src/no-utility-types-config.d.ts +0 -30
  72. package/src/no-utility-types-config.js +0 -39
  73. package/src/no-utility-types-config.js.map +0 -1
  74. package/src/required-type-suffix-config.d.ts +0 -49
  75. package/src/required-type-suffix-config.js +0 -62
  76. package/src/required-type-suffix-config.js.map +0 -1
  77. package/src/rule-configs.d.ts +0 -273
  78. package/src/rule-configs.js +0 -595
  79. package/src/rule-configs.js.map +0 -1
  80. package/src/spec-temp-dirs.d.ts +0 -37
  81. package/src/spec-temp-dirs.js +0 -113
  82. package/src/spec-temp-dirs.js.map +0 -1
  83. package/src/tag-truth-configs.d.ts +0 -137
  84. package/src/tag-truth-configs.js +0 -175
  85. package/src/tag-truth-configs.js.map +0 -1
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NoUtilityTypesInApiLibConfig = void 0;
4
- const field_def_1 = require("./field-def");
5
- const rule_configs_1 = require("./rule-configs");
6
- /**
7
- * `no-utility-types-in-api-lib` (#1026) — in every `.ts` file under `paths`, refuse the TypeScript
8
- * utility types that turn a contract's field list (or its set of keys) into a type-level computation:
9
- * `Omit`, `Pick`, `Partial`, `Required`, `Exclude` and `Extract`. Refused wherever a type is written
10
- * — `interface X extends Omit<…>`, a field type, a type alias, a generic argument.
11
- *
12
- * Why the whole family and not `Omit` alone: every one of them makes a reader open a second file and
13
- * compute the fields (or keys) in their head, none of them can become a DTO class (`class X extends
14
- * Omit<…>` does not compile — a utility type has no runtime value), and banning `Omit` alone just
15
- * moves the same computation into `Pick<T, Exclude<keyof T, K>>`. `Record`, `Readonly`, `Array` and
16
- * friends stay allowed: they do not hide which fields a DTO carries.
17
- *
18
- * Every field that decides behaviour is REQUIRED with no default (`.claude/rules/no-rule-defaults.md`):
19
- * - `mode` — OFF | NEW_AND_MODIFIED_CODE (only changed lines, so existing code is fixed as it is
20
- * touched) | NEW_AND_MODIFIED_FILES (every occurrence in a changed file) | MODIFIED_PROJECTS /
21
- * RUN_EVERY_TIME (every occurrence in a touched project / in the repo — #1027).
22
- * - `paths` — the globs of the API contract libraries this rule judges, e.g. `["libraries/apis/**"]`.
23
- * An empty list judges nothing.
24
- *
25
- * `allowedPaths` exempts whole trees inside `paths`. The per-site escape hatch is
26
- * `// webpieces-disable no-utility-types-in-api-lib -- <reason>` on the line or the line above.
27
- */
28
- class NoUtilityTypesInApiLibConfig extends rule_configs_1.BaseRuleConfig {
29
- paths;
30
- allowedPaths;
31
- static SCHEMA = {
32
- mode: new field_def_1.FieldDef('string', rule_configs_1.MODIFIED_CODE_MODES),
33
- paths: new field_def_1.FieldDef('string[]'),
34
- allowedPaths: field_def_1.FieldDef.optional('string[]'),
35
- ...rule_configs_1.BASE_RULE_SCHEMA,
36
- };
37
- }
38
- exports.NoUtilityTypesInApiLibConfig = NoUtilityTypesInApiLibConfig;
39
- //# sourceMappingURL=no-utility-types-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"no-utility-types-config.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/no-utility-types-config.ts"],"names":[],"mappings":";;;AAAA,2CAAoD;AACpD,iDAAyG;AAEzG;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,4BAA6B,SAAQ,6BAAc;IAE5D,KAAK,CAAY;IACjB,YAAY,CAAY;IAExB,MAAM,CAAU,MAAM,GAA8C;QAChE,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,kCAAmB,CAAC;QACjD,KAAK,EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;QAC/B,YAAY,EAAE,oBAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC3C,GAAG,+BAAgB;KACtB,CAAC;;AAVN,oEAWC","sourcesContent":["import { FieldDef, SchemaShape } from './field-def';\nimport { BaseRuleConfig, BASE_RULE_SCHEMA, ModifiedCodeMode, MODIFIED_CODE_MODES } from './rule-configs';\n\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,49 +0,0 @@
1
- import { SchemaShape } from './field-def';
2
- import { BaseRuleConfig, ModifiedCodeMode } from './rule-configs';
3
- /**
4
- * One `required-type-suffix` entry: the path globs it covers and the suffixes a type exported from a
5
- * file under them may end in. Data-only.
6
- */
7
- export declare class RequiredTypeSuffixEntry {
8
- /** Workspace-relative globs, e.g. `["libraries/apis/internal/**"]`. Non-empty. */
9
- paths: string[];
10
- /** Case-sensitive name suffixes, e.g. `["Request", "Response", "Event", "Dto", "Api"]`. Non-empty. */
11
- suffixes: string[];
12
- static readonly SCHEMA: SchemaShape<RequiredTypeSuffixEntry>;
13
- }
14
- /**
15
- * `required-type-suffix` (#1037) — every EXPORTED `interface`, `class` (abstract too), `enum` and `type`
16
- * alias in a non-test `.ts` file under an entry's `paths` must end in one of that entry's `suffixes`
17
- * (plain, case-sensitive `endsWith`; the suffix alone is not a name). Why: the suffix tells a reader which
18
- * LAYER a type belongs to — a `…Dto` is on the wire, a `…Fs` is a Firestore document — where an
19
- * unsuffixed name reads the same as a server-internal or vendor type.
20
- *
21
- * Every field that decides behaviour is REQUIRED with no default (`.claude/rules/no-rule-defaults.md`):
22
- * - `mode` — OFF | NEW_AND_MODIFIED_CODE (only a type whose declaration line is new or changed — a new or
23
- * renamed type — so legacy names are grandfathered) | NEW_AND_MODIFIED_FILES (every exported type in a
24
- * changed file) | MODIFIED_PROJECTS / RUN_EVERY_TIME (every exported type in each touched project / the
25
- * whole repo — #1027).
26
- * - `entries` — non-empty; each entry has non-empty `paths` and `suffixes`. For example:
27
- *
28
- * "entries": [
29
- * { "paths": ["libraries/apis/internal/**"], "suffixes": ["Request", "Response", "Event", "Dto", "Api"] },
30
- * { "paths": ["libraries/browser-node/fs-*-model/**"], "suffixes": ["Fs"] }
31
- * ]
32
- *
33
- * OVERLAP — the FIRST MATCH in `entries` order wins; suffixes are never unioned. A file is governed by
34
- * exactly one entry: the entries are read top to bottom, and the first one with a glob matching the file
35
- * decides its suffixes. ORDER MATTERS: a narrower entry must be listed BEFORE a broader one. With
36
- * `libraries/apis/internal/**` listed above `libraries/apis/**`, the narrower entry governs
37
- * `libraries/apis/internal/x/src/A.ts`; listed below it, the broader entry governs that file and the
38
- * narrower one never applies there. A failure names the governing entry's glob, so a reader can see
39
- * which entry won.
40
- *
41
- * `allowedPaths` exempts whole trees inside `paths`. The per-site escape hatch is
42
- * `// webpieces-disable required-type-suffix -- <reason>` on the declaration's line or the line above.
43
- */
44
- export declare class RequiredTypeSuffixConfig extends BaseRuleConfig {
45
- mode?: ModifiedCodeMode;
46
- entries: RequiredTypeSuffixEntry[];
47
- allowedPaths?: string[];
48
- static readonly SCHEMA: SchemaShape<RequiredTypeSuffixConfig>;
49
- }
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RequiredTypeSuffixConfig = exports.RequiredTypeSuffixEntry = void 0;
4
- const field_def_1 = require("./field-def");
5
- const rule_configs_1 = require("./rule-configs");
6
- /**
7
- * One `required-type-suffix` entry: the path globs it covers and the suffixes a type exported from a
8
- * file under them may end in. Data-only.
9
- */
10
- class RequiredTypeSuffixEntry {
11
- /** Workspace-relative globs, e.g. `["libraries/apis/internal/**"]`. Non-empty. */
12
- paths;
13
- /** Case-sensitive name suffixes, e.g. `["Request", "Response", "Event", "Dto", "Api"]`. Non-empty. */
14
- suffixes;
15
- static SCHEMA = {
16
- paths: field_def_1.FieldDef.nonEmptyStrings(),
17
- suffixes: field_def_1.FieldDef.nonEmptyStrings(),
18
- };
19
- }
20
- exports.RequiredTypeSuffixEntry = RequiredTypeSuffixEntry;
21
- /**
22
- * `required-type-suffix` (#1037) — every EXPORTED `interface`, `class` (abstract too), `enum` and `type`
23
- * alias in a non-test `.ts` file under an entry's `paths` must end in one of that entry's `suffixes`
24
- * (plain, case-sensitive `endsWith`; the suffix alone is not a name). Why: the suffix tells a reader which
25
- * LAYER a type belongs to — a `…Dto` is on the wire, a `…Fs` is a Firestore document — where an
26
- * unsuffixed name reads the same as a server-internal or vendor type.
27
- *
28
- * Every field that decides behaviour is REQUIRED with no default (`.claude/rules/no-rule-defaults.md`):
29
- * - `mode` — OFF | NEW_AND_MODIFIED_CODE (only a type whose declaration line is new or changed — a new or
30
- * renamed type — so legacy names are grandfathered) | NEW_AND_MODIFIED_FILES (every exported type in a
31
- * changed file) | MODIFIED_PROJECTS / RUN_EVERY_TIME (every exported type in each touched project / the
32
- * whole repo — #1027).
33
- * - `entries` — non-empty; each entry has non-empty `paths` and `suffixes`. For example:
34
- *
35
- * "entries": [
36
- * { "paths": ["libraries/apis/internal/**"], "suffixes": ["Request", "Response", "Event", "Dto", "Api"] },
37
- * { "paths": ["libraries/browser-node/fs-*-model/**"], "suffixes": ["Fs"] }
38
- * ]
39
- *
40
- * OVERLAP — the FIRST MATCH in `entries` order wins; suffixes are never unioned. A file is governed by
41
- * exactly one entry: the entries are read top to bottom, and the first one with a glob matching the file
42
- * decides its suffixes. ORDER MATTERS: a narrower entry must be listed BEFORE a broader one. With
43
- * `libraries/apis/internal/**` listed above `libraries/apis/**`, the narrower entry governs
44
- * `libraries/apis/internal/x/src/A.ts`; listed below it, the broader entry governs that file and the
45
- * narrower one never applies there. A failure names the governing entry's glob, so a reader can see
46
- * which entry won.
47
- *
48
- * `allowedPaths` exempts whole trees inside `paths`. The per-site escape hatch is
49
- * `// webpieces-disable required-type-suffix -- <reason>` on the declaration's line or the line above.
50
- */
51
- class RequiredTypeSuffixConfig extends rule_configs_1.BaseRuleConfig {
52
- entries;
53
- allowedPaths;
54
- static SCHEMA = {
55
- mode: new field_def_1.FieldDef('string', rule_configs_1.MODIFIED_CODE_MODES),
56
- entries: field_def_1.FieldDef.nonEmptyObjects(RequiredTypeSuffixEntry.SCHEMA),
57
- allowedPaths: field_def_1.FieldDef.optional('string[]'),
58
- ...rule_configs_1.BASE_RULE_SCHEMA,
59
- };
60
- }
61
- exports.RequiredTypeSuffixConfig = RequiredTypeSuffixConfig;
62
- //# sourceMappingURL=required-type-suffix-config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"required-type-suffix-config.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/required-type-suffix-config.ts"],"names":[],"mappings":";;;AAAA,2CAAoD;AACpD,iDAAyG;AAEzG;;;GAGG;AACH,MAAa,uBAAuB;IAChC,kFAAkF;IAClF,KAAK,CAAY;IACjB,sGAAsG;IACtG,QAAQ,CAAY;IAEpB,MAAM,CAAU,MAAM,GAAyC;QAC3D,KAAK,EAAE,oBAAQ,CAAC,eAAe,EAAE;QACjC,QAAQ,EAAE,oBAAQ,CAAC,eAAe,EAAE;KACvC,CAAC;;AATN,0DAUC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAa,wBAAyB,SAAQ,6BAAc;IAExD,OAAO,CAA6B;IACpC,YAAY,CAAY;IAExB,MAAM,CAAU,MAAM,GAA0C;QAC5D,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,kCAAmB,CAAC;QACjD,OAAO,EAAE,oBAAQ,CAAC,eAAe,CAAC,uBAAuB,CAAC,MAAM,CAAC;QACjE,YAAY,EAAE,oBAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC3C,GAAG,+BAAgB;KACtB,CAAC;;AAVN,4DAWC","sourcesContent":["import { FieldDef, SchemaShape } from './field-def';\nimport { BaseRuleConfig, BASE_RULE_SCHEMA, ModifiedCodeMode, MODIFIED_CODE_MODES } from './rule-configs';\n\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 name suffixes, e.g. `[\"Request\", \"Response\", \"Event\", \"Dto\", \"Api\"]`. Non-empty. */\n suffixes!: string[];\n\n static readonly SCHEMA: SchemaShape<RequiredTypeSuffixEntry> = {\n paths: FieldDef.nonEmptyStrings(),\n suffixes: FieldDef.nonEmptyStrings(),\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`. For example:\n *\n * \"entries\": [\n * { \"paths\": [\"libraries/apis/internal/**\"], \"suffixes\": [\"Request\", \"Response\", \"Event\", \"Dto\", \"Api\"] },\n * { \"paths\": [\"libraries/browser-node/fs-*-model/**\"], \"suffixes\": [\"Fs\"] }\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,273 +0,0 @@
1
- import { FieldDef, SchemaShape } from './field-def';
2
- export declare const METHOD_LIMIT_MODES: readonly ["OFF", "NEW_METHODS", "NEW_AND_MODIFIED_METHODS", "NEW_AND_MODIFIED_FILES"];
3
- export type MethodLimitMode = typeof METHOD_LIMIT_MODES[number];
4
- export declare const FILE_LIMIT_MODES: readonly ["OFF", "NEW_AND_MODIFIED_FILES"];
5
- export type FileLimitMode = typeof FILE_LIMIT_MODES[number];
6
- export declare const RETURN_TYPE_MODES: readonly ["OFF", "NEW_METHODS", "NEW_AND_MODIFIED_METHODS", "NEW_AND_MODIFIED_FILES"];
7
- export type ReturnTypeMode = typeof RETURN_TYPE_MODES[number];
8
- export declare const INLINE_TYPE_MODES: readonly ["OFF", "NEW_METHODS", "NEW_AND_MODIFIED_METHODS", "NEW_AND_MODIFIED_FILES"];
9
- export type InlineTypeMode = typeof INLINE_TYPE_MODES[number];
10
- export declare const MODIFIED_CODE_MODES: readonly ["OFF", "NEW_AND_MODIFIED_CODE", "NEW_AND_MODIFIED_FILES", "MODIFIED_PROJECTS", "RUN_EVERY_TIME"];
11
- export type ModifiedCodeMode = typeof MODIFIED_CODE_MODES[number];
12
- export declare const PROJECT_MODES: readonly ["OFF", "MODIFIED_PROJECTS"];
13
- export type ProjectMode = typeof PROJECT_MODES[number];
14
- export declare const PRISMA_DTOS_MODES: readonly ["OFF", "MODIFIED_CLASS", "NEW_AND_MODIFIED_FILES"];
15
- export type PrismaValidateDtosMode = typeof PRISMA_DTOS_MODES[number];
16
- export declare const PRISMA_CONVERTER_MODES: readonly ["OFF", "NEW_AND_MODIFIED_METHODS", "NEW_AND_MODIFIED_FILES"];
17
- export type PrismaConverterMode = typeof PRISMA_CONVERTER_MODES[number];
18
- export declare const DIRECT_API_RESOLVER_MODES: readonly ["OFF", "NEW_AND_MODIFIED_CODE", "NEW_AND_MODIFIED_METHODS", "NEW_AND_MODIFIED_FILES"];
19
- export type DirectApiResolverMode = typeof DIRECT_API_RESOLVER_MODES[number];
20
- export declare const THROW_CAUSE_MODES: readonly ["OFF", "NEW_AND_MODIFIED_CODE"];
21
- export type ThrowCauseMode = typeof THROW_CAUSE_MODES[number];
22
- export declare const ON_OFF_MODES: readonly ["ON", "OFF"];
23
- export type OnOffMode = typeof ON_OFF_MODES[number];
24
- export declare const BRANCH_GUARD_MODES: readonly ["ON", "OFF", "ON_NO_SUBBRANCHES"];
25
- export type BranchGuardMode = typeof BRANCH_GUARD_MODES[number];
26
- export declare const VALIDATE_TS_MODES: readonly ["OFF", "NEW_AND_MODIFIED_FILES"];
27
- export type ValidateTsMode = typeof VALIDATE_TS_MODES[number];
28
- export declare const STRUCTURAL_MODES: readonly ["OFF", "RUN_EVERY_TIME"];
29
- export type StructuralMode = typeof STRUCTURAL_MODES[number];
30
- export declare abstract class BaseRuleConfig {
31
- mode?: string;
32
- turnOffRuleUntilEpoch?: number;
33
- turnOffRuleWhileOnBranch?: string | null;
34
- }
35
- export declare const BASE_RULE_SCHEMA: {
36
- turnOffRuleUntilEpoch: FieldDef;
37
- turnOffRuleWhileOnBranch: FieldDef;
38
- };
39
- export declare class MaxMethodLinesConfig extends BaseRuleConfig {
40
- mode?: MethodLimitMode;
41
- limit?: number;
42
- disableAllowed?: boolean;
43
- static readonly SCHEMA: SchemaShape<MaxMethodLinesConfig>;
44
- }
45
- export declare class MaxFileLinesConfig extends BaseRuleConfig {
46
- mode?: FileLimitMode;
47
- limit?: number;
48
- disableAllowed?: boolean;
49
- allowedPaths?: string[];
50
- static readonly SCHEMA: SchemaShape<MaxFileLinesConfig>;
51
- }
52
- export declare class RequireReturnTypeConfig extends BaseRuleConfig {
53
- mode?: ReturnTypeMode;
54
- disableAllowed?: boolean;
55
- static readonly SCHEMA: SchemaShape<RequireReturnTypeConfig>;
56
- }
57
- export declare class NoInlineTypeLiteralsConfig extends BaseRuleConfig {
58
- mode?: InlineTypeMode;
59
- disableAllowed?: boolean;
60
- static readonly SCHEMA: SchemaShape<NoInlineTypeLiteralsConfig>;
61
- }
62
- export declare class NoAnyUnknownConfig extends BaseRuleConfig {
63
- mode?: ModifiedCodeMode;
64
- disableAllowed?: boolean;
65
- static readonly SCHEMA: SchemaShape<NoAnyUnknownConfig>;
66
- }
67
- export declare class NoImplicitAnyConfig extends BaseRuleConfig {
68
- mode?: ModifiedCodeMode;
69
- disableAllowed?: boolean;
70
- static readonly SCHEMA: SchemaShape<NoImplicitAnyConfig>;
71
- }
72
- export declare class PrismaValidateDtosConfig extends BaseRuleConfig {
73
- mode?: PrismaValidateDtosMode;
74
- disableAllowed?: boolean;
75
- prismaSchemaPath?: string;
76
- dtoSourcePaths?: string[];
77
- static readonly SCHEMA: SchemaShape<PrismaValidateDtosConfig>;
78
- }
79
- export declare class PrismaConverterConfig extends BaseRuleConfig {
80
- mode?: PrismaConverterMode;
81
- disableAllowed?: boolean;
82
- schemaPath?: string;
83
- convertersPaths?: string[];
84
- enforcePaths?: string[];
85
- static readonly SCHEMA: SchemaShape<PrismaConverterConfig>;
86
- }
87
- export declare class NoDestructureConfig extends BaseRuleConfig {
88
- mode?: ModifiedCodeMode;
89
- allowTopLevel?: boolean;
90
- disableAllowed?: boolean;
91
- allowedPaths?: string[];
92
- static readonly SCHEMA: SchemaShape<NoDestructureConfig>;
93
- }
94
- export declare class NoUnmanagedExceptionsConfig extends BaseRuleConfig {
95
- mode?: ModifiedCodeMode;
96
- disableAllowed?: boolean;
97
- static readonly SCHEMA: SchemaShape<NoUnmanagedExceptionsConfig>;
98
- }
99
- export declare class CatchErrorPatternConfig extends BaseRuleConfig {
100
- mode?: ModifiedCodeMode;
101
- disableAllowed?: boolean;
102
- static readonly SCHEMA: SchemaShape<CatchErrorPatternConfig>;
103
- }
104
- export declare class ThrowCauseRequiredConfig extends BaseRuleConfig {
105
- mode?: ThrowCauseMode;
106
- disableAllowed?: boolean;
107
- static readonly SCHEMA: SchemaShape<ThrowCauseRequiredConfig>;
108
- }
109
- export declare class AngularNoDirectApiInResolverConfig extends BaseRuleConfig {
110
- mode?: DirectApiResolverMode;
111
- disableAllowed?: boolean;
112
- enforcePaths?: string[];
113
- static readonly SCHEMA: SchemaShape<AngularNoDirectApiInResolverConfig>;
114
- }
115
- export declare class NoCustomCssConfig extends BaseRuleConfig {
116
- mode?: ModifiedCodeMode;
117
- disableAllowed?: boolean;
118
- allowGlobs?: string[];
119
- static readonly SCHEMA: SchemaShape<NoCustomCssConfig>;
120
- }
121
- export declare class NoSymbolDiTokensConfig extends BaseRuleConfig {
122
- mode?: ModifiedCodeMode;
123
- disableAllowed?: boolean;
124
- allowedPaths?: string[];
125
- static readonly SCHEMA: SchemaShape<NoSymbolDiTokensConfig>;
126
- }
127
- export declare class NoProcessExitOutsideMainConfig extends BaseRuleConfig {
128
- mode?: ModifiedCodeMode;
129
- disableAllowed?: boolean;
130
- static readonly SCHEMA: SchemaShape<NoProcessExitOutsideMainConfig>;
131
- }
132
- export declare class NoFunctionOutsideClassConfig extends BaseRuleConfig {
133
- mode?: ModifiedCodeMode;
134
- disableAllowed?: boolean;
135
- allowedPaths?: string[];
136
- static readonly SCHEMA: SchemaShape<NoFunctionOutsideClassConfig>;
137
- }
138
- export declare class InjectAnnotationNotNeededForConcreteClassConfig extends BaseRuleConfig {
139
- mode?: ModifiedCodeMode;
140
- disableAllowed?: boolean;
141
- allowedPaths?: string[];
142
- static readonly SCHEMA: SchemaShape<InjectAnnotationNotNeededForConcreteClassConfig>;
143
- }
144
- export declare class FrameworkTagConfig extends BaseRuleConfig {
145
- mode?: ProjectMode;
146
- knownTypes?: string[];
147
- static readonly SCHEMA: SchemaShape<FrameworkTagConfig>;
148
- }
149
- export declare class RoleTagConfig extends BaseRuleConfig {
150
- mode?: ProjectMode;
151
- knownTypes?: string[];
152
- static readonly SCHEMA: SchemaShape<RoleTagConfig>;
153
- }
154
- export declare class EnsureWeAreSecureConfig extends BaseRuleConfig {
155
- mode?: ProjectMode;
156
- static readonly SCHEMA: SchemaShape<EnsureWeAreSecureConfig>;
157
- }
158
- export declare class BranchCreationGuardConfig extends BaseRuleConfig {
159
- mode?: BranchGuardMode;
160
- subBranchNaming: string;
161
- branchFormat?: string;
162
- maxLocalBranches?: number;
163
- maxWorktrees?: number;
164
- autoReapMergedBranches?: boolean;
165
- static readonly SCHEMA: SchemaShape<BranchCreationGuardConfig>;
166
- }
167
- /**
168
- * `pr-lifecycle-guard` — ONE key, ONE policy: *PRs and merges go through the gated flow.*
169
- *
170
- * Four CLASSES implement it, and their names are unchanged (they are the operator identity every
171
- * decision-log line and every deny report carries):
172
- *
173
- * pr-creation-or-push-guard a manual `git push` / `gh pr create|edit` / a raw pulls API call
174
- * merge-in-progress-guard a PR command while a 3-point merge is half-finished
175
- * pr-merge-guard a bare `gh pr merge`
176
- * redirect-how-to-merge-main "how do I get main into my branch?" → the documented flow
177
- *
178
- * ## Say this out loud: `"mode": "OFF"` releases the unvalidated-merge gate too
179
- *
180
- * Three of the four are pure COMMAND-SHAPE blocks and can never fire spuriously. The fourth,
181
- * merge-in-progress-guard, is STATE-conditional — it fires only while a 3-point merge is actually in
182
- * progress, and it is the one state L2 explicitly stands down for. So turning this key OFF to unblock
183
- * `gh pr merge` ALSO drops the "you have an unfinished merge" gate. That is the honest cost of one key
184
- * per policy, and it is stated here, in guards/L4-pr-lifecycle.md, and in the error path, rather than
185
- * being papered over with a granular sub-mode (which would be four knobs wearing one key's name).
186
- *
187
- * ## The command strings are NOT here
188
- *
189
- * `upsertPrCommand` and `mergeCompleteCommand` used to sit on the two guards, and — being read at the
190
- * point of use — they BEAT `commands.guardHints`, so `guardHintsWhy`'s claim that renaming a gated
191
- * command there makes "every guard message follow" was simply false. They are DELETED, not deprecated.
192
- * `commands.guardHints.prCreationOrPush` / `.mergeInProgress` is the one place those strings live, and
193
- * the loader hands the resolved values to the two rules directly. A consumer that still sets the old
194
- * per-guard field gets a RETIRED_FIELD_HINTS error naming the destination.
195
- */
196
- export declare class PrLifecycleGuardConfig extends BaseRuleConfig {
197
- mode?: OnOffMode;
198
- static readonly SCHEMA: SchemaShape<PrLifecycleGuardConfig>;
199
- }
200
- export declare class NoFileImportCyclesConfig extends BaseRuleConfig {
201
- mode?: StructuralMode;
202
- ignoreTypeOnly?: boolean;
203
- excludePackages?: string[];
204
- excludeRegExp?: string[];
205
- static readonly SCHEMA: SchemaShape<NoFileImportCyclesConfig>;
206
- }
207
- export declare class RuntimeArchitectureConfig extends BaseRuleConfig {
208
- mode?: StructuralMode;
209
- /**
210
- * Draw a dashed terminal node for every contract a service calls that NOTHING in-repo
211
- * implements (firestore, gmail, ...) — the vendor systems the runtime graph otherwise stops one
212
- * hop short of. Defaults to true; set false in a repo whose external surface is noisy. Purely a
213
- * RENDER switch: levels, cycle detection and runtime-dependencies.json are identical either way.
214
- */
215
- showExternalNodes?: boolean;
216
- /**
217
- * Project roots whose exported `*Api` types are contracts for systems OUTSIDE this repo
218
- * (firestore, gmail, gcp-storage, ...), e.g. `["libraries/apis/external/**"]`. Globs, matched
219
- * against the nx project root.
220
- *
221
- * Needed because an external contract does NOT look like an in-repo one: it is a plain
222
- * `interface` bound to a Symbol token and injected, never an `abstract class` carrying @ApiPath
223
- * reached through `createRpcClient`. Without this list the scanner has no way to tell a vendor
224
- * seam from any other library, so every call leaving the repo is invisible to the runtime graph.
225
- *
226
- * Defaults to none, which is correct for a repo with no vendor wrapper libraries.
227
- */
228
- externalApiPaths?: string[];
229
- static readonly SCHEMA: SchemaShape<RuntimeArchitectureConfig>;
230
- }
231
- export declare class NxWiringConfig extends BaseRuleConfig {
232
- mode?: StructuralMode;
233
- static readonly SCHEMA: SchemaShape<NxWiringConfig>;
234
- }
235
- export declare class DiGraphConfig extends BaseRuleConfig {
236
- mode?: StructuralMode;
237
- static readonly SCHEMA: SchemaShape<DiGraphConfig>;
238
- }
239
- export declare class MissingDesignAnnotationConfig extends BaseRuleConfig {
240
- mode?: StructuralMode;
241
- static readonly SCHEMA: SchemaShape<MissingDesignAnnotationConfig>;
242
- }
243
- export declare class NoJsFilesConfig extends BaseRuleConfig {
244
- mode?: FileLimitMode;
245
- allowedPaths?: string[];
246
- static readonly SCHEMA: SchemaShape<NoJsFilesConfig>;
247
- }
248
- export declare class ValidateArchitectureUnchangedConfig extends BaseRuleConfig {
249
- mode?: StructuralMode;
250
- static readonly SCHEMA: SchemaShape<ValidateArchitectureUnchangedConfig>;
251
- }
252
- export declare class ValidateNoArchitectureCyclesConfig extends BaseRuleConfig {
253
- mode?: StructuralMode;
254
- static readonly SCHEMA: SchemaShape<ValidateNoArchitectureCyclesConfig>;
255
- }
256
- export declare class ValidatePackageJsonConfig extends BaseRuleConfig {
257
- mode?: StructuralMode;
258
- static readonly SCHEMA: SchemaShape<ValidatePackageJsonConfig>;
259
- }
260
- export declare class ValidateVersionsLockedConfig extends BaseRuleConfig {
261
- mode?: StructuralMode;
262
- static readonly SCHEMA: SchemaShape<ValidateVersionsLockedConfig>;
263
- }
264
- export declare class ValidateEslintSyncConfig extends BaseRuleConfig {
265
- mode?: StructuralMode;
266
- static readonly SCHEMA: SchemaShape<ValidateEslintSyncConfig>;
267
- }
268
- export declare class ValidateTsInSrcConfig extends BaseRuleConfig {
269
- mode?: ValidateTsMode;
270
- allowedRootFiles?: string[];
271
- excludePaths?: string[];
272
- static readonly SCHEMA: SchemaShape<ValidateTsInSrcConfig>;
273
- }