@webpieces/rules-config 0.3.180 → 0.3.182

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webpieces/rules-config",
3
- "version": "0.3.180",
3
+ "version": "0.3.182",
4
4
  "description": "Shared webpieces.config.json loader. Single source of truth for validation rule configuration consumed by @webpieces/ai-hook-rules, @webpieces/code-rules, and @webpieces/nx-webpieces-rules.",
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
@@ -2,7 +2,10 @@ type FieldType = 'string' | 'number' | 'boolean' | 'string[]';
2
2
  export declare class FieldDef {
3
3
  readonly type: FieldType;
4
4
  readonly enumValues?: readonly string[] | undefined;
5
- constructor(type: FieldType, enumValues?: readonly string[] | undefined);
5
+ readonly optional: boolean;
6
+ constructor(type: FieldType, enumValues?: readonly string[] | undefined, optional?: boolean);
7
+ /** Marks a field as optional (omittable) in the config schema. */
8
+ static optional(type: FieldType, enumValues?: readonly string[]): FieldDef;
6
9
  }
7
10
  export type SchemaShape<T> = {
8
11
  [K in keyof Required<T>]: FieldDef;
package/src/field-def.js CHANGED
@@ -4,9 +4,18 @@ exports.FieldDef = void 0;
4
4
  class FieldDef {
5
5
  type;
6
6
  enumValues;
7
- constructor(type, enumValues) {
7
+ optional;
8
+ constructor(type, enumValues,
9
+ // When true, the field is omittable: the missing-rule snippet lists it
10
+ // as optional rather than as a required copy-paste field.
11
+ optional = false) {
8
12
  this.type = type;
9
13
  this.enumValues = enumValues;
14
+ this.optional = optional;
15
+ }
16
+ /** Marks a field as optional (omittable) in the config schema. */
17
+ static optional(type, enumValues) {
18
+ return new FieldDef(type, enumValues, true);
10
19
  }
11
20
  }
12
21
  exports.FieldDef = FieldDef;
@@ -1 +1 @@
1
- {"version":3,"file":"field-def.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/field-def.ts"],"names":[],"mappings":";;;AAEA,MAAa,QAAQ;IAEJ;IACA;IAFb,YACa,IAAe,EACf,UAA8B;QAD9B,SAAI,GAAJ,IAAI,CAAW;QACf,eAAU,GAAV,UAAU,CAAoB;IACxC,CAAC;CACP;AALD,4BAKC","sourcesContent":["type FieldType = 'string' | 'number' | 'boolean' | 'string[]';\n\nexport class FieldDef {\n constructor(\n readonly type: FieldType,\n readonly enumValues?: readonly string[],\n ) {}\n}\n\n// Enforces that a static SCHEMA has exactly the same keys as the config class.\n// Add a field to the class → TS errors until SCHEMA is updated.\n// Add to SCHEMA without adding to class → TS errors (extra property).\nexport type SchemaShape<T> = { [K in keyof Required<T>]: FieldDef };\n"]}
1
+ {"version":3,"file":"field-def.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/field-def.ts"],"names":[],"mappings":";;;AAEA,MAAa,QAAQ;IAEJ;IACA;IAGA;IALb,YACa,IAAe,EACf,UAA8B;IACvC,uEAAuE;IACvE,0DAA0D;IACjD,WAAoB,KAAK;QAJzB,SAAI,GAAJ,IAAI,CAAW;QACf,eAAU,GAAV,UAAU,CAAoB;QAG9B,aAAQ,GAAR,QAAQ,CAAiB;IACnC,CAAC;IAEJ,kEAAkE;IAClE,MAAM,CAAC,QAAQ,CAAC,IAAe,EAAE,UAA8B;QAC3D,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IAChD,CAAC;CACJ;AAbD,4BAaC","sourcesContent":["type FieldType = 'string' | 'number' | 'boolean' | 'string[]';\n\nexport class FieldDef {\n constructor(\n readonly type: FieldType,\n readonly enumValues?: readonly string[],\n // When true, the field is omittable: the missing-rule snippet lists it\n // as optional rather than as a required copy-paste field.\n readonly optional: boolean = false,\n ) {}\n\n /** Marks a field as optional (omittable) in the config schema. */\n static optional(type: FieldType, enumValues?: readonly string[]): FieldDef {\n return new FieldDef(type, enumValues, true);\n }\n}\n\n// Enforces that a static SCHEMA has exactly the same keys as the config class.\n// Add a field to the class → TS errors until SCHEMA is updated.\n// Add to SCHEMA without adding to class → TS errors (extra property).\nexport type SchemaShape<T> = { [K in keyof Required<T>]: FieldDef };\n"]}
package/src/index.d.ts CHANGED
@@ -9,5 +9,7 @@ export { loadTemplate, writeTemplateIfMissing, writeTemplate } from './load-temp
9
9
  export { validateWebpiecesConfig } from './validate-config';
10
10
  export { FieldDef } from './field-def';
11
11
  export type { SchemaShape } from './field-def';
12
+ export { shouldSkipRule, getCurrentBranch } from './skip-rule';
13
+ export type { SkipRuleResult } from './skip-rule';
12
14
  export { WebpiecesRulesConfig } from './WebpiecesRulesConfig';
13
15
  export { MaxMethodLinesConfig, MaxFileLinesConfig, RequireReturnTypeConfig, NoInlineTypeLiteralsConfig, NoAnyUnknownConfig, NoImplicitAnyConfig, PrismaValidateDtosConfig, PrismaConverterConfig, NoDestructureConfig, NoUnmanagedExceptionsConfig, CatchErrorPatternConfig, ThrowCauseRequiredConfig, AngularNoDirectApiInResolverConfig, NoSymbolDiTokensConfig, NoShellSubstitutionConfig, BranchCreationGuardConfig, PrCreationGuardConfig, PrMergeCleanupConfig, NoDirectMainUpdateConfig, NoEditOnMainConfig, NoFileImportCyclesConfig, RuntimeArchitectureConfig, NoJsFilesConfig, ValidateTsInSrcConfig, } from './rule-configs';
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ValidateTsInSrcConfig = exports.NoJsFilesConfig = exports.RuntimeArchitectureConfig = exports.NoFileImportCyclesConfig = exports.NoEditOnMainConfig = exports.NoDirectMainUpdateConfig = exports.PrMergeCleanupConfig = exports.PrCreationGuardConfig = exports.BranchCreationGuardConfig = exports.NoShellSubstitutionConfig = exports.NoSymbolDiTokensConfig = exports.AngularNoDirectApiInResolverConfig = exports.ThrowCauseRequiredConfig = exports.CatchErrorPatternConfig = exports.NoUnmanagedExceptionsConfig = exports.NoDestructureConfig = exports.PrismaConverterConfig = exports.PrismaValidateDtosConfig = exports.NoImplicitAnyConfig = exports.NoAnyUnknownConfig = exports.NoInlineTypeLiteralsConfig = exports.RequireReturnTypeConfig = exports.MaxFileLinesConfig = exports.MaxMethodLinesConfig = exports.WebpiecesRulesConfig = exports.FieldDef = exports.validateWebpiecesConfig = exports.writeTemplate = exports.writeTemplateIfMissing = exports.loadTemplate = exports.defaultRulesDir = exports.defaultRules = exports.isPathExcluded = exports.loadWebpiecesRulesConfig = exports.CONFIG_FILENAME = exports.findConfigFile = exports.loadConfig = exports.toError = exports.InformAiError = exports.ResolvedRuleConfig = exports.ResolvedConfig = void 0;
3
+ exports.ValidateTsInSrcConfig = exports.NoJsFilesConfig = exports.RuntimeArchitectureConfig = exports.NoFileImportCyclesConfig = exports.NoEditOnMainConfig = exports.NoDirectMainUpdateConfig = exports.PrMergeCleanupConfig = exports.PrCreationGuardConfig = exports.BranchCreationGuardConfig = exports.NoShellSubstitutionConfig = exports.NoSymbolDiTokensConfig = exports.AngularNoDirectApiInResolverConfig = exports.ThrowCauseRequiredConfig = exports.CatchErrorPatternConfig = exports.NoUnmanagedExceptionsConfig = exports.NoDestructureConfig = exports.PrismaConverterConfig = exports.PrismaValidateDtosConfig = exports.NoImplicitAnyConfig = exports.NoAnyUnknownConfig = exports.NoInlineTypeLiteralsConfig = exports.RequireReturnTypeConfig = exports.MaxFileLinesConfig = exports.MaxMethodLinesConfig = exports.WebpiecesRulesConfig = exports.getCurrentBranch = exports.shouldSkipRule = exports.FieldDef = exports.validateWebpiecesConfig = exports.writeTemplate = exports.writeTemplateIfMissing = exports.loadTemplate = exports.defaultRulesDir = exports.defaultRules = exports.isPathExcluded = exports.loadWebpiecesRulesConfig = exports.CONFIG_FILENAME = exports.findConfigFile = exports.loadConfig = exports.toError = exports.InformAiError = exports.ResolvedRuleConfig = exports.ResolvedConfig = void 0;
4
4
  var types_1 = require("./types");
5
5
  Object.defineProperty(exports, "ResolvedConfig", { enumerable: true, get: function () { return types_1.ResolvedConfig; } });
6
6
  Object.defineProperty(exports, "ResolvedRuleConfig", { enumerable: true, get: function () { return types_1.ResolvedRuleConfig; } });
@@ -26,6 +26,9 @@ var validate_config_1 = require("./validate-config");
26
26
  Object.defineProperty(exports, "validateWebpiecesConfig", { enumerable: true, get: function () { return validate_config_1.validateWebpiecesConfig; } });
27
27
  var field_def_1 = require("./field-def");
28
28
  Object.defineProperty(exports, "FieldDef", { enumerable: true, get: function () { return field_def_1.FieldDef; } });
29
+ var skip_rule_1 = require("./skip-rule");
30
+ Object.defineProperty(exports, "shouldSkipRule", { enumerable: true, get: function () { return skip_rule_1.shouldSkipRule; } });
31
+ Object.defineProperty(exports, "getCurrentBranch", { enumerable: true, get: function () { return skip_rule_1.getCurrentBranch; } });
29
32
  var WebpiecesRulesConfig_1 = require("./WebpiecesRulesConfig");
30
33
  Object.defineProperty(exports, "WebpiecesRulesConfig", { enumerable: true, get: function () { return WebpiecesRulesConfig_1.WebpiecesRulesConfig; } });
31
34
  var rule_configs_1 = require("./rule-configs");
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/index.ts"],"names":[],"mappings":";;;AAAA,iCAA0E;AAAjE,uGAAA,cAAc,OAAA;AAAE,2GAAA,kBAAkB,OAAA;AAC3C,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,6CAAsG;AAA7F,yGAAA,UAAU,OAAA;AAAE,6GAAA,cAAc,OAAA;AAAE,8GAAA,eAAe,OAAA;AAAE,uHAAA,wBAAwB,OAAA;AAE9E,iDAAiD;AAAxC,+GAAA,cAAc,OAAA;AACvB,iDAAgE;AAAvD,6GAAA,YAAY,OAAA;AAAE,gHAAA,eAAe,OAAA;AACtC,iDAAsF;AAA7E,6GAAA,YAAY,OAAA;AAAE,uHAAA,sBAAsB,OAAA;AAAE,8GAAA,aAAa,OAAA;AAC5D,qDAA4D;AAAnD,0HAAA,uBAAuB,OAAA;AAChC,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AAEjB,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,+CAyBwB;AAxBpB,oHAAA,oBAAoB,OAAA;AACpB,kHAAA,kBAAkB,OAAA;AAClB,uHAAA,uBAAuB,OAAA;AACvB,0HAAA,0BAA0B,OAAA;AAC1B,kHAAA,kBAAkB,OAAA;AAClB,mHAAA,mBAAmB,OAAA;AACnB,wHAAA,wBAAwB,OAAA;AACxB,qHAAA,qBAAqB,OAAA;AACrB,mHAAA,mBAAmB,OAAA;AACnB,2HAAA,2BAA2B,OAAA;AAC3B,uHAAA,uBAAuB,OAAA;AACvB,wHAAA,wBAAwB,OAAA;AACxB,kIAAA,kCAAkC,OAAA;AAClC,sHAAA,sBAAsB,OAAA;AACtB,yHAAA,yBAAyB,OAAA;AACzB,yHAAA,yBAAyB,OAAA;AACzB,qHAAA,qBAAqB,OAAA;AACrB,oHAAA,oBAAoB,OAAA;AACpB,wHAAA,wBAAwB,OAAA;AACxB,kHAAA,kBAAkB,OAAA;AAClB,wHAAA,wBAAwB,OAAA;AACxB,yHAAA,yBAAyB,OAAA;AACzB,+GAAA,eAAe,OAAA;AACf,qHAAA,qBAAqB,OAAA","sourcesContent":["export { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\nexport { InformAiError } from './inform-ai-error';\nexport { toError } from './to-error';\nexport { loadConfig, findConfigFile, CONFIG_FILENAME, loadWebpiecesRulesConfig } from './load-config';\nexport type { LoadedWebpiecesConfig } from './load-config';\nexport { isPathExcluded } from './exclude-paths';\nexport { defaultRules, defaultRulesDir } from './default-rules';\nexport { loadTemplate, writeTemplateIfMissing, writeTemplate } from './load-template';\nexport { validateWebpiecesConfig } from './validate-config';\nexport { FieldDef } from './field-def';\nexport type { SchemaShape } from './field-def';\nexport { WebpiecesRulesConfig } from './WebpiecesRulesConfig';\nexport {\n MaxMethodLinesConfig,\n MaxFileLinesConfig,\n RequireReturnTypeConfig,\n NoInlineTypeLiteralsConfig,\n NoAnyUnknownConfig,\n NoImplicitAnyConfig,\n PrismaValidateDtosConfig,\n PrismaConverterConfig,\n NoDestructureConfig,\n NoUnmanagedExceptionsConfig,\n CatchErrorPatternConfig,\n ThrowCauseRequiredConfig,\n AngularNoDirectApiInResolverConfig,\n NoSymbolDiTokensConfig,\n NoShellSubstitutionConfig,\n BranchCreationGuardConfig,\n PrCreationGuardConfig,\n PrMergeCleanupConfig,\n NoDirectMainUpdateConfig,\n NoEditOnMainConfig,\n NoFileImportCyclesConfig,\n RuntimeArchitectureConfig,\n NoJsFilesConfig,\n ValidateTsInSrcConfig,\n} from './rule-configs';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/index.ts"],"names":[],"mappings":";;;AAAA,iCAA0E;AAAjE,uGAAA,cAAc,OAAA;AAAE,2GAAA,kBAAkB,OAAA;AAC3C,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,6CAAsG;AAA7F,yGAAA,UAAU,OAAA;AAAE,6GAAA,cAAc,OAAA;AAAE,8GAAA,eAAe,OAAA;AAAE,uHAAA,wBAAwB,OAAA;AAE9E,iDAAiD;AAAxC,+GAAA,cAAc,OAAA;AACvB,iDAAgE;AAAvD,6GAAA,YAAY,OAAA;AAAE,gHAAA,eAAe,OAAA;AACtC,iDAAsF;AAA7E,6GAAA,YAAY,OAAA;AAAE,uHAAA,sBAAsB,OAAA;AAAE,8GAAA,aAAa,OAAA;AAC5D,qDAA4D;AAAnD,0HAAA,uBAAuB,OAAA;AAChC,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AAEjB,yCAA+D;AAAtD,2GAAA,cAAc,OAAA;AAAE,6GAAA,gBAAgB,OAAA;AAEzC,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,+CAyBwB;AAxBpB,oHAAA,oBAAoB,OAAA;AACpB,kHAAA,kBAAkB,OAAA;AAClB,uHAAA,uBAAuB,OAAA;AACvB,0HAAA,0BAA0B,OAAA;AAC1B,kHAAA,kBAAkB,OAAA;AAClB,mHAAA,mBAAmB,OAAA;AACnB,wHAAA,wBAAwB,OAAA;AACxB,qHAAA,qBAAqB,OAAA;AACrB,mHAAA,mBAAmB,OAAA;AACnB,2HAAA,2BAA2B,OAAA;AAC3B,uHAAA,uBAAuB,OAAA;AACvB,wHAAA,wBAAwB,OAAA;AACxB,kIAAA,kCAAkC,OAAA;AAClC,sHAAA,sBAAsB,OAAA;AACtB,yHAAA,yBAAyB,OAAA;AACzB,yHAAA,yBAAyB,OAAA;AACzB,qHAAA,qBAAqB,OAAA;AACrB,oHAAA,oBAAoB,OAAA;AACpB,wHAAA,wBAAwB,OAAA;AACxB,kHAAA,kBAAkB,OAAA;AAClB,wHAAA,wBAAwB,OAAA;AACxB,yHAAA,yBAAyB,OAAA;AACzB,+GAAA,eAAe,OAAA;AACf,qHAAA,qBAAqB,OAAA","sourcesContent":["export { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\nexport { InformAiError } from './inform-ai-error';\nexport { toError } from './to-error';\nexport { loadConfig, findConfigFile, CONFIG_FILENAME, loadWebpiecesRulesConfig } from './load-config';\nexport type { LoadedWebpiecesConfig } from './load-config';\nexport { isPathExcluded } from './exclude-paths';\nexport { defaultRules, defaultRulesDir } from './default-rules';\nexport { loadTemplate, writeTemplateIfMissing, writeTemplate } from './load-template';\nexport { validateWebpiecesConfig } from './validate-config';\nexport { FieldDef } from './field-def';\nexport type { SchemaShape } from './field-def';\nexport { shouldSkipRule, getCurrentBranch } from './skip-rule';\nexport type { SkipRuleResult } from './skip-rule';\nexport { WebpiecesRulesConfig } from './WebpiecesRulesConfig';\nexport {\n MaxMethodLinesConfig,\n MaxFileLinesConfig,\n RequireReturnTypeConfig,\n NoInlineTypeLiteralsConfig,\n NoAnyUnknownConfig,\n NoImplicitAnyConfig,\n PrismaValidateDtosConfig,\n PrismaConverterConfig,\n NoDestructureConfig,\n NoUnmanagedExceptionsConfig,\n CatchErrorPatternConfig,\n ThrowCauseRequiredConfig,\n AngularNoDirectApiInResolverConfig,\n NoSymbolDiTokensConfig,\n NoShellSubstitutionConfig,\n BranchCreationGuardConfig,\n PrCreationGuardConfig,\n PrMergeCleanupConfig,\n NoDirectMainUpdateConfig,\n NoEditOnMainConfig,\n NoFileImportCyclesConfig,\n RuntimeArchitectureConfig,\n NoJsFilesConfig,\n ValidateTsInSrcConfig,\n} from './rule-configs';\n"]}
@@ -1,4 +1,4 @@
1
- import { SchemaShape } from './field-def';
1
+ import { FieldDef, SchemaShape } from './field-def';
2
2
  declare const METHOD_LIMIT_MODES: readonly ["OFF", "NEW_METHODS", "NEW_AND_MODIFIED_METHODS", "MODIFIED_FILES"];
3
3
  type MethodLimitMode = typeof METHOD_LIMIT_MODES[number];
4
4
  declare const FILE_LIMIT_MODES: readonly ["OFF", "MODIFIED_FILES"];
@@ -21,162 +21,142 @@ declare const ON_OFF_MODES: readonly ["ON", "OFF"];
21
21
  type OnOffMode = typeof ON_OFF_MODES[number];
22
22
  declare const VALIDATE_TS_MODES: readonly ["ON", "OFF", "MODIFIED_FILES"];
23
23
  type ValidateTsMode = typeof VALIDATE_TS_MODES[number];
24
- export declare class MaxMethodLinesConfig {
24
+ export declare abstract class BaseRuleConfig {
25
+ ignoreModifiedUntilEpoch?: number;
26
+ ignoreRuleWhileOnBranch?: string;
27
+ }
28
+ export declare const BASE_RULE_SCHEMA: {
29
+ ignoreModifiedUntilEpoch: FieldDef;
30
+ ignoreRuleWhileOnBranch: FieldDef;
31
+ };
32
+ export declare class MaxMethodLinesConfig extends BaseRuleConfig {
25
33
  mode?: MethodLimitMode;
26
34
  limit?: number;
27
35
  disableAllowed?: boolean;
28
- ignoreModifiedUntilEpoch?: number;
29
- ignoreRuleWhileOnBranch?: string;
30
36
  static readonly SCHEMA: SchemaShape<MaxMethodLinesConfig>;
31
37
  }
32
- export declare class MaxFileLinesConfig {
38
+ export declare class MaxFileLinesConfig extends BaseRuleConfig {
33
39
  mode?: FileLimitMode;
34
40
  limit?: number;
35
41
  disableAllowed?: boolean;
36
- ignoreModifiedUntilEpoch?: number;
37
- ignoreRuleWhileOnBranch?: string;
38
42
  static readonly SCHEMA: SchemaShape<MaxFileLinesConfig>;
39
43
  }
40
- export declare class RequireReturnTypeConfig {
44
+ export declare class RequireReturnTypeConfig extends BaseRuleConfig {
41
45
  mode?: ReturnTypeModeLocal;
42
46
  disableAllowed?: boolean;
43
- ignoreModifiedUntilEpoch?: number;
44
- ignoreRuleWhileOnBranch?: string;
45
47
  static readonly SCHEMA: SchemaShape<RequireReturnTypeConfig>;
46
48
  }
47
- export declare class NoInlineTypeLiteralsConfig {
49
+ export declare class NoInlineTypeLiteralsConfig extends BaseRuleConfig {
48
50
  mode?: InlineTypeModeLocal;
49
51
  disableAllowed?: boolean;
50
- ignoreModifiedUntilEpoch?: number;
51
- ignoreRuleWhileOnBranch?: string;
52
52
  static readonly SCHEMA: SchemaShape<NoInlineTypeLiteralsConfig>;
53
53
  }
54
- export declare class NoAnyUnknownConfig {
54
+ export declare class NoAnyUnknownConfig extends BaseRuleConfig {
55
55
  mode?: ModifiedCodeMode;
56
56
  disableAllowed?: boolean;
57
- ignoreModifiedUntilEpoch?: number;
58
- ignoreRuleWhileOnBranch?: string;
59
57
  static readonly SCHEMA: SchemaShape<NoAnyUnknownConfig>;
60
58
  }
61
- export declare class NoImplicitAnyConfig {
59
+ export declare class NoImplicitAnyConfig extends BaseRuleConfig {
62
60
  mode?: ModifiedCodeMode;
63
61
  disableAllowed?: boolean;
64
- ignoreModifiedUntilEpoch?: number;
65
- ignoreRuleWhileOnBranch?: string;
66
62
  static readonly SCHEMA: SchemaShape<NoImplicitAnyConfig>;
67
63
  }
68
- export declare class PrismaValidateDtosConfig {
64
+ export declare class PrismaValidateDtosConfig extends BaseRuleConfig {
69
65
  mode?: PrismaValidateDtosMode;
70
66
  disableAllowed?: boolean;
71
67
  prismaSchemaPath?: string;
72
68
  dtoSourcePaths?: string[];
73
- ignoreModifiedUntilEpoch?: number;
74
- ignoreRuleWhileOnBranch?: string;
75
69
  static readonly SCHEMA: SchemaShape<PrismaValidateDtosConfig>;
76
70
  }
77
- export declare class PrismaConverterConfig {
71
+ export declare class PrismaConverterConfig extends BaseRuleConfig {
78
72
  mode?: PrismaConverterModeLocal;
79
73
  disableAllowed?: boolean;
80
74
  schemaPath?: string;
81
75
  convertersPaths?: string[];
82
76
  enforcePaths?: string[];
83
- ignoreModifiedUntilEpoch?: number;
84
- ignoreRuleWhileOnBranch?: string;
85
77
  static readonly SCHEMA: SchemaShape<PrismaConverterConfig>;
86
78
  }
87
- export declare class NoDestructureConfig {
79
+ export declare class NoDestructureConfig extends BaseRuleConfig {
88
80
  mode?: ModifiedCodeMode;
89
81
  allowTopLevel?: boolean;
90
82
  disableAllowed?: boolean;
91
- ignoreModifiedUntilEpoch?: number;
92
- ignoreRuleWhileOnBranch?: string;
93
83
  static readonly SCHEMA: SchemaShape<NoDestructureConfig>;
94
84
  }
95
- export declare class NoUnmanagedExceptionsConfig {
85
+ export declare class NoUnmanagedExceptionsConfig extends BaseRuleConfig {
96
86
  mode?: ModifiedCodeMode;
97
87
  disableAllowed?: boolean;
98
- ignoreModifiedUntilEpoch?: number;
99
- ignoreRuleWhileOnBranch?: string;
100
88
  static readonly SCHEMA: SchemaShape<NoUnmanagedExceptionsConfig>;
101
89
  }
102
- export declare class CatchErrorPatternConfig {
90
+ export declare class CatchErrorPatternConfig extends BaseRuleConfig {
103
91
  mode?: ModifiedCodeMode;
104
92
  disableAllowed?: boolean;
105
- ignoreModifiedUntilEpoch?: number;
106
- ignoreRuleWhileOnBranch?: string;
107
93
  static readonly SCHEMA: SchemaShape<CatchErrorPatternConfig>;
108
94
  }
109
- export declare class ThrowCauseRequiredConfig {
95
+ export declare class ThrowCauseRequiredConfig extends BaseRuleConfig {
110
96
  mode?: ThrowCauseModeLocal;
111
97
  disableAllowed?: boolean;
112
- ignoreModifiedUntilEpoch?: number;
113
- ignoreRuleWhileOnBranch?: string;
114
98
  static readonly SCHEMA: SchemaShape<ThrowCauseRequiredConfig>;
115
99
  }
116
- export declare class AngularNoDirectApiInResolverConfig {
100
+ export declare class AngularNoDirectApiInResolverConfig extends BaseRuleConfig {
117
101
  mode?: DirectApiResolverMode;
118
102
  disableAllowed?: boolean;
119
- ignoreModifiedUntilEpoch?: number;
120
- ignoreRuleWhileOnBranch?: string;
121
103
  enforcePaths?: string[];
122
104
  static readonly SCHEMA: SchemaShape<AngularNoDirectApiInResolverConfig>;
123
105
  }
124
- export declare class NoSymbolDiTokensConfig {
106
+ export declare class NoSymbolDiTokensConfig extends BaseRuleConfig {
125
107
  mode?: ModifiedCodeMode;
126
108
  disableAllowed?: boolean;
127
- ignoreModifiedUntilEpoch?: number;
128
- ignoreRuleWhileOnBranch?: string;
129
109
  allowedPaths?: string[];
130
110
  static readonly SCHEMA: SchemaShape<NoSymbolDiTokensConfig>;
131
111
  }
132
- export declare class NoShellSubstitutionConfig {
112
+ export declare class NoShellSubstitutionConfig extends BaseRuleConfig {
133
113
  mode?: OnOffMode;
134
114
  static readonly SCHEMA: SchemaShape<NoShellSubstitutionConfig>;
135
115
  }
136
- export declare class BranchCreationGuardConfig {
116
+ export declare class BranchCreationGuardConfig extends BaseRuleConfig {
137
117
  mode?: OnOffMode;
138
118
  subBranchNaming?: string;
139
119
  static readonly SCHEMA: SchemaShape<BranchCreationGuardConfig>;
140
120
  }
141
- export declare class PrCreationGuardConfig {
121
+ export declare class PrCreationGuardConfig extends BaseRuleConfig {
142
122
  mode?: OnOffMode;
143
123
  buildCommand?: string;
144
124
  requireTextInPr?: string;
145
125
  static readonly SCHEMA: SchemaShape<PrCreationGuardConfig>;
146
126
  }
147
- export declare class PrMergeCleanupConfig {
127
+ export declare class PrMergeCleanupConfig extends BaseRuleConfig {
148
128
  mode?: OnOffMode;
149
129
  static readonly SCHEMA: SchemaShape<PrMergeCleanupConfig>;
150
130
  }
151
- export declare class NoDirectMainUpdateConfig {
131
+ export declare class NoDirectMainUpdateConfig extends BaseRuleConfig {
152
132
  mode?: OnOffMode;
153
133
  static readonly SCHEMA: SchemaShape<NoDirectMainUpdateConfig>;
154
134
  }
155
- export declare class NoEditOnMainConfig {
135
+ export declare class NoEditOnMainConfig extends BaseRuleConfig {
156
136
  mode?: OnOffMode;
157
137
  branchNamingConvention?: string;
158
138
  static readonly SCHEMA: SchemaShape<NoEditOnMainConfig>;
159
139
  }
160
- export declare class NoFileImportCyclesConfig {
140
+ export declare class NoFileImportCyclesConfig extends BaseRuleConfig {
161
141
  mode?: OnOffMode;
162
142
  ignoreTypeOnly?: boolean;
143
+ excludePackages?: string[];
163
144
  static readonly SCHEMA: SchemaShape<NoFileImportCyclesConfig>;
164
145
  }
165
- export declare class RuntimeArchitectureConfig {
146
+ export declare class RuntimeArchitectureConfig extends BaseRuleConfig {
166
147
  mode?: OnOffMode;
167
148
  servicePaths?: string[];
168
149
  apiProjectPaths?: string[];
169
150
  allowedCycles?: string[];
170
151
  static readonly SCHEMA: SchemaShape<RuntimeArchitectureConfig>;
171
152
  }
172
- export declare class NoJsFilesConfig {
153
+ export declare class NoJsFilesConfig extends BaseRuleConfig {
173
154
  mode?: OnOffMode;
174
155
  allowedPaths?: string[];
175
156
  static readonly SCHEMA: SchemaShape<NoJsFilesConfig>;
176
157
  }
177
- export declare class ValidateTsInSrcConfig {
158
+ export declare class ValidateTsInSrcConfig extends BaseRuleConfig {
178
159
  mode?: ValidateTsMode;
179
- ignoreModifiedUntilEpoch?: number;
180
160
  allowedRootFiles?: string[];
181
161
  excludePaths?: string[];
182
162
  static readonly SCHEMA: SchemaShape<ValidateTsInSrcConfig>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ValidateTsInSrcConfig = exports.NoJsFilesConfig = exports.RuntimeArchitectureConfig = exports.NoFileImportCyclesConfig = exports.NoEditOnMainConfig = exports.NoDirectMainUpdateConfig = exports.PrMergeCleanupConfig = exports.PrCreationGuardConfig = exports.BranchCreationGuardConfig = exports.NoShellSubstitutionConfig = exports.NoSymbolDiTokensConfig = exports.AngularNoDirectApiInResolverConfig = exports.ThrowCauseRequiredConfig = exports.CatchErrorPatternConfig = exports.NoUnmanagedExceptionsConfig = exports.NoDestructureConfig = exports.PrismaConverterConfig = exports.PrismaValidateDtosConfig = exports.NoImplicitAnyConfig = exports.NoAnyUnknownConfig = exports.NoInlineTypeLiteralsConfig = exports.RequireReturnTypeConfig = exports.MaxFileLinesConfig = exports.MaxMethodLinesConfig = void 0;
3
+ exports.ValidateTsInSrcConfig = exports.NoJsFilesConfig = exports.RuntimeArchitectureConfig = exports.NoFileImportCyclesConfig = exports.NoEditOnMainConfig = exports.NoDirectMainUpdateConfig = exports.PrMergeCleanupConfig = exports.PrCreationGuardConfig = exports.BranchCreationGuardConfig = exports.NoShellSubstitutionConfig = exports.NoSymbolDiTokensConfig = exports.AngularNoDirectApiInResolverConfig = exports.ThrowCauseRequiredConfig = exports.CatchErrorPatternConfig = exports.NoUnmanagedExceptionsConfig = exports.NoDestructureConfig = exports.PrismaConverterConfig = exports.PrismaValidateDtosConfig = exports.NoImplicitAnyConfig = exports.NoAnyUnknownConfig = exports.NoInlineTypeLiteralsConfig = exports.RequireReturnTypeConfig = exports.MaxFileLinesConfig = exports.MaxMethodLinesConfig = exports.BASE_RULE_SCHEMA = exports.BaseRuleConfig = void 0;
4
4
  const field_def_1 = require("./field-def");
5
5
  // Mode const arrays — TypeScript union types derived from them, and FieldDef enum
6
6
  // values reference the same array. Impossible for the type and runtime check to diverge.
@@ -15,299 +15,284 @@ const DIRECT_API_RESOLVER_MODES = ['OFF', 'MODIFIED_CODE', 'NEW_AND_MODIFIED_MET
15
15
  const THROW_CAUSE_MODES = ['ON', 'OFF', 'MODIFIED_CODE'];
16
16
  const ON_OFF_MODES = ['ON', 'OFF'];
17
17
  const VALIDATE_TS_MODES = ['ON', 'OFF', 'MODIFIED_FILES'];
18
- class MaxMethodLinesConfig {
18
+ // ---------------------------------------------------------------------------
19
+ // Universal escape hatches — EVERY rule supports temporarily disabling itself
20
+ // either while on a named git branch (ignoreRuleWhileOnBranch) or until an
21
+ // epoch passes (ignoreModifiedUntilEpoch). Both are optional. They live on a
22
+ // shared base class so the two fields (and their schema entries) are declared
23
+ // once instead of repeated per rule. `mode` stays per-rule because its allowed
24
+ // values vary (ON/OFF vs MODIFIED_CODE vs NEW_AND_MODIFIED_METHODS, etc).
25
+ // ---------------------------------------------------------------------------
26
+ class BaseRuleConfig {
27
+ ignoreModifiedUntilEpoch;
28
+ ignoreRuleWhileOnBranch;
29
+ }
30
+ exports.BaseRuleConfig = BaseRuleConfig;
31
+ exports.BASE_RULE_SCHEMA = {
32
+ ignoreModifiedUntilEpoch: field_def_1.FieldDef.optional('number'),
33
+ ignoreRuleWhileOnBranch: field_def_1.FieldDef.optional('string'),
34
+ };
35
+ class MaxMethodLinesConfig extends BaseRuleConfig {
19
36
  mode;
20
37
  limit;
21
38
  disableAllowed;
22
- ignoreModifiedUntilEpoch;
23
- ignoreRuleWhileOnBranch;
24
39
  static SCHEMA = {
25
40
  mode: new field_def_1.FieldDef('string', METHOD_LIMIT_MODES),
26
- limit: new field_def_1.FieldDef('number'),
27
- disableAllowed: new field_def_1.FieldDef('boolean'),
28
- ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
29
- ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
41
+ limit: field_def_1.FieldDef.optional('number'),
42
+ disableAllowed: field_def_1.FieldDef.optional('boolean'),
43
+ ...exports.BASE_RULE_SCHEMA,
30
44
  };
31
45
  }
32
46
  exports.MaxMethodLinesConfig = MaxMethodLinesConfig;
33
- class MaxFileLinesConfig {
47
+ class MaxFileLinesConfig extends BaseRuleConfig {
34
48
  mode;
35
49
  limit;
36
50
  disableAllowed;
37
- ignoreModifiedUntilEpoch;
38
- ignoreRuleWhileOnBranch;
39
51
  static SCHEMA = {
40
52
  mode: new field_def_1.FieldDef('string', FILE_LIMIT_MODES),
41
- limit: new field_def_1.FieldDef('number'),
42
- disableAllowed: new field_def_1.FieldDef('boolean'),
43
- ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
44
- ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
53
+ limit: field_def_1.FieldDef.optional('number'),
54
+ disableAllowed: field_def_1.FieldDef.optional('boolean'),
55
+ ...exports.BASE_RULE_SCHEMA,
45
56
  };
46
57
  }
47
58
  exports.MaxFileLinesConfig = MaxFileLinesConfig;
48
- class RequireReturnTypeConfig {
59
+ class RequireReturnTypeConfig extends BaseRuleConfig {
49
60
  mode;
50
61
  disableAllowed;
51
- ignoreModifiedUntilEpoch;
52
- ignoreRuleWhileOnBranch;
53
62
  static SCHEMA = {
54
63
  mode: new field_def_1.FieldDef('string', RETURN_TYPE_MODES),
55
- disableAllowed: new field_def_1.FieldDef('boolean'),
56
- ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
57
- ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
64
+ disableAllowed: field_def_1.FieldDef.optional('boolean'),
65
+ ...exports.BASE_RULE_SCHEMA,
58
66
  };
59
67
  }
60
68
  exports.RequireReturnTypeConfig = RequireReturnTypeConfig;
61
- class NoInlineTypeLiteralsConfig {
69
+ class NoInlineTypeLiteralsConfig extends BaseRuleConfig {
62
70
  mode;
63
71
  disableAllowed;
64
- ignoreModifiedUntilEpoch;
65
- ignoreRuleWhileOnBranch;
66
72
  static SCHEMA = {
67
73
  mode: new field_def_1.FieldDef('string', INLINE_TYPE_MODES),
68
- disableAllowed: new field_def_1.FieldDef('boolean'),
69
- ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
70
- ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
74
+ disableAllowed: field_def_1.FieldDef.optional('boolean'),
75
+ ...exports.BASE_RULE_SCHEMA,
71
76
  };
72
77
  }
73
78
  exports.NoInlineTypeLiteralsConfig = NoInlineTypeLiteralsConfig;
74
- class NoAnyUnknownConfig {
79
+ class NoAnyUnknownConfig extends BaseRuleConfig {
75
80
  mode;
76
81
  disableAllowed;
77
- ignoreModifiedUntilEpoch;
78
- ignoreRuleWhileOnBranch;
79
82
  static SCHEMA = {
80
83
  mode: new field_def_1.FieldDef('string', MODIFIED_CODE_MODES),
81
- disableAllowed: new field_def_1.FieldDef('boolean'),
82
- ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
83
- ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
84
+ disableAllowed: field_def_1.FieldDef.optional('boolean'),
85
+ ...exports.BASE_RULE_SCHEMA,
84
86
  };
85
87
  }
86
88
  exports.NoAnyUnknownConfig = NoAnyUnknownConfig;
87
- class NoImplicitAnyConfig {
89
+ class NoImplicitAnyConfig extends BaseRuleConfig {
88
90
  mode;
89
91
  disableAllowed;
90
- ignoreModifiedUntilEpoch;
91
- ignoreRuleWhileOnBranch;
92
92
  static SCHEMA = {
93
93
  mode: new field_def_1.FieldDef('string', MODIFIED_CODE_MODES),
94
- disableAllowed: new field_def_1.FieldDef('boolean'),
95
- ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
96
- ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
94
+ disableAllowed: field_def_1.FieldDef.optional('boolean'),
95
+ ...exports.BASE_RULE_SCHEMA,
97
96
  };
98
97
  }
99
98
  exports.NoImplicitAnyConfig = NoImplicitAnyConfig;
100
- class PrismaValidateDtosConfig {
99
+ class PrismaValidateDtosConfig extends BaseRuleConfig {
101
100
  mode;
102
101
  disableAllowed;
103
102
  prismaSchemaPath;
104
103
  dtoSourcePaths;
105
- ignoreModifiedUntilEpoch;
106
- ignoreRuleWhileOnBranch;
107
104
  static SCHEMA = {
108
105
  mode: new field_def_1.FieldDef('string', PRISMA_DTOS_MODES),
109
- disableAllowed: new field_def_1.FieldDef('boolean'),
110
- prismaSchemaPath: new field_def_1.FieldDef('string'),
111
- dtoSourcePaths: new field_def_1.FieldDef('string[]'),
112
- ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
113
- ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
106
+ disableAllowed: field_def_1.FieldDef.optional('boolean'),
107
+ prismaSchemaPath: field_def_1.FieldDef.optional('string'),
108
+ dtoSourcePaths: field_def_1.FieldDef.optional('string[]'),
109
+ ...exports.BASE_RULE_SCHEMA,
114
110
  };
115
111
  }
116
112
  exports.PrismaValidateDtosConfig = PrismaValidateDtosConfig;
117
- class PrismaConverterConfig {
113
+ class PrismaConverterConfig extends BaseRuleConfig {
118
114
  mode;
119
115
  disableAllowed;
120
116
  schemaPath;
121
117
  convertersPaths;
122
118
  enforcePaths;
123
- ignoreModifiedUntilEpoch;
124
- ignoreRuleWhileOnBranch;
125
119
  static SCHEMA = {
126
120
  mode: new field_def_1.FieldDef('string', PRISMA_CONVERTER_MODES),
127
- disableAllowed: new field_def_1.FieldDef('boolean'),
128
- schemaPath: new field_def_1.FieldDef('string'),
129
- convertersPaths: new field_def_1.FieldDef('string[]'),
130
- enforcePaths: new field_def_1.FieldDef('string[]'),
131
- ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
132
- ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
121
+ disableAllowed: field_def_1.FieldDef.optional('boolean'),
122
+ schemaPath: field_def_1.FieldDef.optional('string'),
123
+ convertersPaths: field_def_1.FieldDef.optional('string[]'),
124
+ enforcePaths: field_def_1.FieldDef.optional('string[]'),
125
+ ...exports.BASE_RULE_SCHEMA,
133
126
  };
134
127
  }
135
128
  exports.PrismaConverterConfig = PrismaConverterConfig;
136
- class NoDestructureConfig {
129
+ class NoDestructureConfig extends BaseRuleConfig {
137
130
  mode;
138
131
  allowTopLevel;
139
132
  disableAllowed;
140
- ignoreModifiedUntilEpoch;
141
- ignoreRuleWhileOnBranch;
142
133
  static SCHEMA = {
143
134
  mode: new field_def_1.FieldDef('string', MODIFIED_CODE_MODES),
144
- allowTopLevel: new field_def_1.FieldDef('boolean'),
145
- disableAllowed: new field_def_1.FieldDef('boolean'),
146
- ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
147
- ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
135
+ allowTopLevel: field_def_1.FieldDef.optional('boolean'),
136
+ disableAllowed: field_def_1.FieldDef.optional('boolean'),
137
+ ...exports.BASE_RULE_SCHEMA,
148
138
  };
149
139
  }
150
140
  exports.NoDestructureConfig = NoDestructureConfig;
151
- class NoUnmanagedExceptionsConfig {
141
+ class NoUnmanagedExceptionsConfig extends BaseRuleConfig {
152
142
  mode;
153
143
  disableAllowed;
154
- ignoreModifiedUntilEpoch;
155
- ignoreRuleWhileOnBranch;
156
144
  static SCHEMA = {
157
145
  mode: new field_def_1.FieldDef('string', MODIFIED_CODE_MODES),
158
- disableAllowed: new field_def_1.FieldDef('boolean'),
159
- ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
160
- ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
146
+ disableAllowed: field_def_1.FieldDef.optional('boolean'),
147
+ ...exports.BASE_RULE_SCHEMA,
161
148
  };
162
149
  }
163
150
  exports.NoUnmanagedExceptionsConfig = NoUnmanagedExceptionsConfig;
164
- class CatchErrorPatternConfig {
151
+ class CatchErrorPatternConfig extends BaseRuleConfig {
165
152
  mode;
166
153
  disableAllowed;
167
- ignoreModifiedUntilEpoch;
168
- ignoreRuleWhileOnBranch;
169
154
  static SCHEMA = {
170
155
  mode: new field_def_1.FieldDef('string', MODIFIED_CODE_MODES),
171
- disableAllowed: new field_def_1.FieldDef('boolean'),
172
- ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
173
- ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
156
+ disableAllowed: field_def_1.FieldDef.optional('boolean'),
157
+ ...exports.BASE_RULE_SCHEMA,
174
158
  };
175
159
  }
176
160
  exports.CatchErrorPatternConfig = CatchErrorPatternConfig;
177
- class ThrowCauseRequiredConfig {
161
+ class ThrowCauseRequiredConfig extends BaseRuleConfig {
178
162
  mode;
179
163
  disableAllowed;
180
- ignoreModifiedUntilEpoch;
181
- ignoreRuleWhileOnBranch;
182
164
  static SCHEMA = {
183
165
  mode: new field_def_1.FieldDef('string', THROW_CAUSE_MODES),
184
- disableAllowed: new field_def_1.FieldDef('boolean'),
185
- ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
186
- ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
166
+ disableAllowed: field_def_1.FieldDef.optional('boolean'),
167
+ ...exports.BASE_RULE_SCHEMA,
187
168
  };
188
169
  }
189
170
  exports.ThrowCauseRequiredConfig = ThrowCauseRequiredConfig;
190
- class AngularNoDirectApiInResolverConfig {
171
+ class AngularNoDirectApiInResolverConfig extends BaseRuleConfig {
191
172
  mode;
192
173
  disableAllowed;
193
- ignoreModifiedUntilEpoch;
194
- ignoreRuleWhileOnBranch;
195
174
  enforcePaths;
196
175
  static SCHEMA = {
197
176
  mode: new field_def_1.FieldDef('string', DIRECT_API_RESOLVER_MODES),
198
- disableAllowed: new field_def_1.FieldDef('boolean'),
199
- ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
200
- ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
201
- enforcePaths: new field_def_1.FieldDef('string[]'),
177
+ disableAllowed: field_def_1.FieldDef.optional('boolean'),
178
+ enforcePaths: field_def_1.FieldDef.optional('string[]'),
179
+ ...exports.BASE_RULE_SCHEMA,
202
180
  };
203
181
  }
204
182
  exports.AngularNoDirectApiInResolverConfig = AngularNoDirectApiInResolverConfig;
205
- class NoSymbolDiTokensConfig {
183
+ class NoSymbolDiTokensConfig extends BaseRuleConfig {
206
184
  mode;
207
185
  disableAllowed;
208
- ignoreModifiedUntilEpoch;
209
- ignoreRuleWhileOnBranch;
210
186
  allowedPaths;
211
187
  static SCHEMA = {
212
188
  mode: new field_def_1.FieldDef('string', MODIFIED_CODE_MODES),
213
- disableAllowed: new field_def_1.FieldDef('boolean'),
214
- ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
215
- ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
216
- allowedPaths: new field_def_1.FieldDef('string[]'),
189
+ disableAllowed: field_def_1.FieldDef.optional('boolean'),
190
+ allowedPaths: field_def_1.FieldDef.optional('string[]'),
191
+ ...exports.BASE_RULE_SCHEMA,
217
192
  };
218
193
  }
219
194
  exports.NoSymbolDiTokensConfig = NoSymbolDiTokensConfig;
220
- class NoShellSubstitutionConfig {
195
+ class NoShellSubstitutionConfig extends BaseRuleConfig {
221
196
  mode;
222
197
  static SCHEMA = {
223
198
  mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
199
+ ...exports.BASE_RULE_SCHEMA,
224
200
  };
225
201
  }
226
202
  exports.NoShellSubstitutionConfig = NoShellSubstitutionConfig;
227
- class BranchCreationGuardConfig {
203
+ class BranchCreationGuardConfig extends BaseRuleConfig {
228
204
  mode;
229
205
  subBranchNaming;
230
206
  static SCHEMA = {
231
207
  mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
232
- subBranchNaming: new field_def_1.FieldDef('string'),
208
+ subBranchNaming: field_def_1.FieldDef.optional('string'),
209
+ ...exports.BASE_RULE_SCHEMA,
233
210
  };
234
211
  }
235
212
  exports.BranchCreationGuardConfig = BranchCreationGuardConfig;
236
- class PrCreationGuardConfig {
213
+ class PrCreationGuardConfig extends BaseRuleConfig {
237
214
  mode;
238
215
  buildCommand;
239
216
  requireTextInPr;
240
217
  static SCHEMA = {
241
218
  mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
242
- buildCommand: new field_def_1.FieldDef('string'),
243
- requireTextInPr: new field_def_1.FieldDef('string'),
219
+ buildCommand: field_def_1.FieldDef.optional('string'),
220
+ requireTextInPr: field_def_1.FieldDef.optional('string'),
221
+ ...exports.BASE_RULE_SCHEMA,
244
222
  };
245
223
  }
246
224
  exports.PrCreationGuardConfig = PrCreationGuardConfig;
247
- class PrMergeCleanupConfig {
225
+ class PrMergeCleanupConfig extends BaseRuleConfig {
248
226
  mode;
249
227
  static SCHEMA = {
250
228
  mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
229
+ ...exports.BASE_RULE_SCHEMA,
251
230
  };
252
231
  }
253
232
  exports.PrMergeCleanupConfig = PrMergeCleanupConfig;
254
- class NoDirectMainUpdateConfig {
233
+ class NoDirectMainUpdateConfig extends BaseRuleConfig {
255
234
  mode;
256
235
  static SCHEMA = {
257
236
  mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
237
+ ...exports.BASE_RULE_SCHEMA,
258
238
  };
259
239
  }
260
240
  exports.NoDirectMainUpdateConfig = NoDirectMainUpdateConfig;
261
- class NoEditOnMainConfig {
241
+ class NoEditOnMainConfig extends BaseRuleConfig {
262
242
  mode;
263
243
  branchNamingConvention;
264
244
  static SCHEMA = {
265
245
  mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
266
- branchNamingConvention: new field_def_1.FieldDef('string'),
246
+ branchNamingConvention: field_def_1.FieldDef.optional('string'),
247
+ ...exports.BASE_RULE_SCHEMA,
267
248
  };
268
249
  }
269
250
  exports.NoEditOnMainConfig = NoEditOnMainConfig;
270
- class NoFileImportCyclesConfig {
251
+ class NoFileImportCyclesConfig extends BaseRuleConfig {
271
252
  mode;
272
253
  ignoreTypeOnly;
254
+ excludePackages;
273
255
  static SCHEMA = {
274
256
  mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
275
- ignoreTypeOnly: new field_def_1.FieldDef('boolean'),
257
+ ignoreTypeOnly: field_def_1.FieldDef.optional('boolean'),
258
+ excludePackages: field_def_1.FieldDef.optional('string[]'),
259
+ ...exports.BASE_RULE_SCHEMA,
276
260
  };
277
261
  }
278
262
  exports.NoFileImportCyclesConfig = NoFileImportCyclesConfig;
279
- class RuntimeArchitectureConfig {
263
+ class RuntimeArchitectureConfig extends BaseRuleConfig {
280
264
  mode;
281
265
  servicePaths;
282
266
  apiProjectPaths;
283
267
  allowedCycles;
284
268
  static SCHEMA = {
285
269
  mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
286
- servicePaths: new field_def_1.FieldDef('string[]'),
287
- apiProjectPaths: new field_def_1.FieldDef('string[]'),
288
- allowedCycles: new field_def_1.FieldDef('string[]'),
270
+ servicePaths: field_def_1.FieldDef.optional('string[]'),
271
+ apiProjectPaths: field_def_1.FieldDef.optional('string[]'),
272
+ allowedCycles: field_def_1.FieldDef.optional('string[]'),
273
+ ...exports.BASE_RULE_SCHEMA,
289
274
  };
290
275
  }
291
276
  exports.RuntimeArchitectureConfig = RuntimeArchitectureConfig;
292
- class NoJsFilesConfig {
277
+ class NoJsFilesConfig extends BaseRuleConfig {
293
278
  mode;
294
279
  allowedPaths;
295
280
  static SCHEMA = {
296
281
  mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
297
- allowedPaths: new field_def_1.FieldDef('string[]'),
282
+ allowedPaths: field_def_1.FieldDef.optional('string[]'),
283
+ ...exports.BASE_RULE_SCHEMA,
298
284
  };
299
285
  }
300
286
  exports.NoJsFilesConfig = NoJsFilesConfig;
301
- class ValidateTsInSrcConfig {
287
+ class ValidateTsInSrcConfig extends BaseRuleConfig {
302
288
  mode;
303
- ignoreModifiedUntilEpoch;
304
289
  allowedRootFiles;
305
290
  excludePaths;
306
291
  static SCHEMA = {
307
292
  mode: new field_def_1.FieldDef('string', VALIDATE_TS_MODES),
308
- ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
309
- allowedRootFiles: new field_def_1.FieldDef('string[]'),
310
- excludePaths: new field_def_1.FieldDef('string[]'),
293
+ allowedRootFiles: field_def_1.FieldDef.optional('string[]'),
294
+ excludePaths: field_def_1.FieldDef.optional('string[]'),
295
+ ...exports.BASE_RULE_SCHEMA,
311
296
  };
312
297
  }
313
298
  exports.ValidateTsInSrcConfig = ValidateTsInSrcConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"rule-configs.js","sour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eAAe,CAAY;IAC3B,aAAa,CAAY;IAEzB,MAAM,CAAU,MAAM,GAA2C;QAC7D,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;QAC1C,YAAY,EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;QACtC,eAAe,EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;QACzC,aAAa,EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;KAC1C,CAAC;;AAXN,8DAYC;AAED,MAAa,eAAe;IACxB,IAAI,CAAa;IACjB,YAAY,CAAY;IAExB,MAAM,CAAU,MAAM,GAAiC;QACnD,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;QAC1C,YAAY,EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;KACzC,CAAC;;AAPN,0CAQC;AAED,MAAa,qBAAqB;IAC9B,IAAI,CAAkB;IACtB,wBAAwB,CAAU;IAClC,gBAAgB,CAAY;IAC5B,YAAY,CAAY;IAExB,MAAM,CAAU,MAAM,GAAuC;QACzD,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;QAC/C,wBAAwB,EAAE,IAAI,oBAAQ,CAAC,QAAQ,CAAC;QAChD,gBAAgB,EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;QAC1C,YAAY,EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;KACzC,CAAC;;AAXN,sDAYC","sourcesContent":["import { FieldDef, SchemaShape } from './field-def';\n\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\nconst METHOD_LIMIT_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'] as const;\ntype MethodLimitMode = typeof METHOD_LIMIT_MODES[number];\n\nconst FILE_LIMIT_MODES = ['OFF', 'MODIFIED_FILES'] as const;\ntype FileLimitMode = typeof FILE_LIMIT_MODES[number];\n\nconst RETURN_TYPE_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'] as const;\ntype ReturnTypeModeLocal = typeof RETURN_TYPE_MODES[number];\n\nconst INLINE_TYPE_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'] as const;\ntype InlineTypeModeLocal = typeof INLINE_TYPE_MODES[number];\n\nconst MODIFIED_CODE_MODES = ['OFF', 'MODIFIED_CODE', 'MODIFIED_FILES'] as const;\ntype ModifiedCodeMode = typeof MODIFIED_CODE_MODES[number];\n\nconst PRISMA_DTOS_MODES = ['OFF', 'MODIFIED_CLASS', 'MODIFIED_FILES'] as const;\ntype PrismaValidateDtosMode = typeof PRISMA_DTOS_MODES[number];\n\nconst PRISMA_CONVERTER_MODES = ['OFF', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'] as const;\ntype PrismaConverterModeLocal = typeof PRISMA_CONVERTER_MODES[number];\n\nconst DIRECT_API_RESOLVER_MODES = ['OFF', 'MODIFIED_CODE', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'] as const;\ntype DirectApiResolverMode = typeof DIRECT_API_RESOLVER_MODES[number];\n\nconst THROW_CAUSE_MODES = ['ON', 'OFF', 'MODIFIED_CODE'] as const;\ntype ThrowCauseModeLocal = typeof THROW_CAUSE_MODES[number];\n\nconst ON_OFF_MODES = ['ON', 'OFF'] as const;\ntype OnOffMode = typeof ON_OFF_MODES[number];\n\nconst VALIDATE_TS_MODES = ['ON', 'OFF', 'MODIFIED_FILES'] as const;\ntype ValidateTsMode = typeof VALIDATE_TS_MODES[number];\n\nexport class MaxMethodLinesConfig {\n mode?: MethodLimitMode;\n limit?: number;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<MaxMethodLinesConfig> = {\n mode: new FieldDef('string', METHOD_LIMIT_MODES),\n limit: new FieldDef('number'),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class MaxFileLinesConfig {\n mode?: FileLimitMode;\n limit?: number;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<MaxFileLinesConfig> = {\n mode: new FieldDef('string', FILE_LIMIT_MODES),\n limit: new FieldDef('number'),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class RequireReturnTypeConfig {\n mode?: ReturnTypeModeLocal;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<RequireReturnTypeConfig> = {\n mode: new FieldDef('string', RETURN_TYPE_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class NoInlineTypeLiteralsConfig {\n mode?: InlineTypeModeLocal;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<NoInlineTypeLiteralsConfig> = {\n mode: new FieldDef('string', INLINE_TYPE_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class NoAnyUnknownConfig {\n mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<NoAnyUnknownConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class NoImplicitAnyConfig {\n mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<NoImplicitAnyConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class PrismaValidateDtosConfig {\n mode?: PrismaValidateDtosMode;\n disableAllowed?: boolean;\n prismaSchemaPath?: string;\n dtoSourcePaths?: string[];\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<PrismaValidateDtosConfig> = {\n mode: new FieldDef('string', PRISMA_DTOS_MODES),\n disableAllowed: new FieldDef('boolean'),\n prismaSchemaPath: new FieldDef('string'),\n dtoSourcePaths: new FieldDef('string[]'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class PrismaConverterConfig {\n mode?: PrismaConverterModeLocal;\n disableAllowed?: boolean;\n schemaPath?: string;\n convertersPaths?: string[];\n enforcePaths?: string[];\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<PrismaConverterConfig> = {\n mode: new FieldDef('string', PRISMA_CONVERTER_MODES),\n disableAllowed: new FieldDef('boolean'),\n schemaPath: new FieldDef('string'),\n convertersPaths: new FieldDef('string[]'),\n enforcePaths: new FieldDef('string[]'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class NoDestructureConfig {\n mode?: ModifiedCodeMode;\n allowTopLevel?: boolean;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<NoDestructureConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n allowTopLevel: new FieldDef('boolean'),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class NoUnmanagedExceptionsConfig {\n mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<NoUnmanagedExceptionsConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class CatchErrorPatternConfig {\n mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<CatchErrorPatternConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class ThrowCauseRequiredConfig {\n mode?: ThrowCauseModeLocal;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<ThrowCauseRequiredConfig> = {\n mode: new FieldDef('string', THROW_CAUSE_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class AngularNoDirectApiInResolverConfig {\n mode?: DirectApiResolverMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n enforcePaths?: string[];\n\n static readonly SCHEMA: SchemaShape<AngularNoDirectApiInResolverConfig> = {\n mode: new FieldDef('string', DIRECT_API_RESOLVER_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n enforcePaths: new FieldDef('string[]'),\n };\n}\n\nexport class NoSymbolDiTokensConfig {\n mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n allowedPaths?: string[];\n\n static readonly SCHEMA: SchemaShape<NoSymbolDiTokensConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n allowedPaths: new FieldDef('string[]'),\n };\n}\n\nexport class NoShellSubstitutionConfig {\n mode?: OnOffMode;\n\n static readonly SCHEMA: SchemaShape<NoShellSubstitutionConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n };\n}\n\nexport class BranchCreationGuardConfig {\n mode?: OnOffMode;\n subBranchNaming?: string;\n\n static readonly SCHEMA: SchemaShape<BranchCreationGuardConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n subBranchNaming: new FieldDef('string'),\n };\n}\n\nexport class PrCreationGuardConfig {\n mode?: OnOffMode;\n buildCommand?: string;\n requireTextInPr?: string;\n\n static readonly SCHEMA: SchemaShape<PrCreationGuardConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n buildCommand: new FieldDef('string'),\n requireTextInPr: new FieldDef('string'),\n };\n}\n\nexport class PrMergeCleanupConfig {\n mode?: OnOffMode;\n\n static readonly SCHEMA: SchemaShape<PrMergeCleanupConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n };\n}\n\nexport class NoDirectMainUpdateConfig {\n mode?: OnOffMode;\n\n static readonly SCHEMA: SchemaShape<NoDirectMainUpdateConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n };\n}\n\nexport class NoEditOnMainConfig {\n mode?: OnOffMode;\n branchNamingConvention?: string;\n\n static readonly SCHEMA: SchemaShape<NoEditOnMainConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n branchNamingConvention: new FieldDef('string'),\n };\n}\n\nexport class NoFileImportCyclesConfig {\n mode?: OnOffMode;\n ignoreTypeOnly?: boolean;\n\n static readonly SCHEMA: SchemaShape<NoFileImportCyclesConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n ignoreTypeOnly: new FieldDef('boolean'),\n };\n}\n\nexport class RuntimeArchitectureConfig {\n mode?: OnOffMode;\n servicePaths?: string[];\n apiProjectPaths?: string[];\n allowedCycles?: string[];\n\n static readonly SCHEMA: SchemaShape<RuntimeArchitectureConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n servicePaths: new FieldDef('string[]'),\n apiProjectPaths: new FieldDef('string[]'),\n allowedCycles: new FieldDef('string[]'),\n };\n}\n\nexport class NoJsFilesConfig {\n mode?: OnOffMode;\n allowedPaths?: string[];\n\n static readonly SCHEMA: SchemaShape<NoJsFilesConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n allowedPaths: new FieldDef('string[]'),\n };\n}\n\nexport class ValidateTsInSrcConfig {\n mode?: ValidateTsMode;\n ignoreModifiedUntilEpoch?: number;\n allowedRootFiles?: string[];\n excludePaths?: string[];\n\n static readonly SCHEMA: SchemaShape<ValidateTsInSrcConfig> = {\n mode: new FieldDef('string', VALIDATE_TS_MODES),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n allowedRootFiles: new FieldDef('string[]'),\n excludePaths: new FieldDef('string[]'),\n };\n}\n"]}
1
+ {"version":3,"file":"rule-configs.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/rule-configs.ts"],"names":[],"mappings":";;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E,iBAAiB,CAAC;QAC/C,gBAAgB,EAAE,oBAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC/C,YAAY,EAAE,oBAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC3C,GAAG,wBAAgB;KACtB,CAAC;;AAVN,sDAWC","sourcesContent":["import { FieldDef, SchemaShape } from './field-def';\n\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\nconst METHOD_LIMIT_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'] as const;\ntype MethodLimitMode = typeof METHOD_LIMIT_MODES[number];\n\nconst FILE_LIMIT_MODES = ['OFF', 'MODIFIED_FILES'] as const;\ntype FileLimitMode = typeof FILE_LIMIT_MODES[number];\n\nconst RETURN_TYPE_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'] as const;\ntype ReturnTypeModeLocal = typeof RETURN_TYPE_MODES[number];\n\nconst INLINE_TYPE_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'] as const;\ntype InlineTypeModeLocal = typeof INLINE_TYPE_MODES[number];\n\nconst MODIFIED_CODE_MODES = ['OFF', 'MODIFIED_CODE', 'MODIFIED_FILES'] as const;\ntype ModifiedCodeMode = typeof MODIFIED_CODE_MODES[number];\n\nconst PRISMA_DTOS_MODES = ['OFF', 'MODIFIED_CLASS', 'MODIFIED_FILES'] as const;\ntype PrismaValidateDtosMode = typeof PRISMA_DTOS_MODES[number];\n\nconst PRISMA_CONVERTER_MODES = ['OFF', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'] as const;\ntype PrismaConverterModeLocal = typeof PRISMA_CONVERTER_MODES[number];\n\nconst DIRECT_API_RESOLVER_MODES = ['OFF', 'MODIFIED_CODE', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'] as const;\ntype DirectApiResolverMode = typeof DIRECT_API_RESOLVER_MODES[number];\n\nconst THROW_CAUSE_MODES = ['ON', 'OFF', 'MODIFIED_CODE'] as const;\ntype ThrowCauseModeLocal = typeof THROW_CAUSE_MODES[number];\n\nconst ON_OFF_MODES = ['ON', 'OFF'] as const;\ntype OnOffMode = typeof ON_OFF_MODES[number];\n\nconst VALIDATE_TS_MODES = ['ON', 'OFF', 'MODIFIED_FILES'] as const;\ntype ValidateTsMode = typeof VALIDATE_TS_MODES[number];\n\n// ---------------------------------------------------------------------------\n// Universal escape hatches — EVERY rule supports temporarily disabling itself\n// either while on a named git branch (ignoreRuleWhileOnBranch) or until an\n// epoch passes (ignoreModifiedUntilEpoch). Both are optional. They live on a\n// shared base class so the two fields (and their schema entries) are declared\n// once instead of repeated per rule. `mode` stays per-rule because its allowed\n// values vary (ON/OFF vs MODIFIED_CODE vs NEW_AND_MODIFIED_METHODS, etc).\n// ---------------------------------------------------------------------------\nexport abstract class BaseRuleConfig {\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n}\n\nexport const BASE_RULE_SCHEMA = {\n ignoreModifiedUntilEpoch: FieldDef.optional('number'),\n ignoreRuleWhileOnBranch: FieldDef.optional('string'),\n};\n\nexport class MaxMethodLinesConfig extends BaseRuleConfig {\n 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\nexport class MaxFileLinesConfig extends BaseRuleConfig {\n 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 ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class RequireReturnTypeConfig extends BaseRuleConfig {\n mode?: ReturnTypeModeLocal;\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 mode?: InlineTypeModeLocal;\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 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 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 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 mode?: PrismaConverterModeLocal;\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\nexport class NoDestructureConfig extends BaseRuleConfig {\n 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 ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class NoUnmanagedExceptionsConfig extends BaseRuleConfig {\n 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 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 ThrowCauseRequiredConfig extends BaseRuleConfig {\n mode?: ThrowCauseModeLocal;\n disableAllowed?: boolean;\n\n static readonly SCHEMA: SchemaShape<ThrowCauseRequiredConfig> = {\n mode: new FieldDef('string', THROW_CAUSE_MODES),\n disableAllowed: FieldDef.optional('boolean'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class AngularNoDirectApiInResolverConfig extends BaseRuleConfig {\n 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\nexport class NoSymbolDiTokensConfig extends BaseRuleConfig {\n 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\nexport class NoShellSubstitutionConfig extends BaseRuleConfig {\n mode?: OnOffMode;\n\n static readonly SCHEMA: SchemaShape<NoShellSubstitutionConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class BranchCreationGuardConfig extends BaseRuleConfig {\n mode?: OnOffMode;\n subBranchNaming?: string;\n\n static readonly SCHEMA: SchemaShape<BranchCreationGuardConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n subBranchNaming: FieldDef.optional('string'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class PrCreationGuardConfig extends BaseRuleConfig {\n mode?: OnOffMode;\n buildCommand?: string;\n requireTextInPr?: string;\n\n static readonly SCHEMA: SchemaShape<PrCreationGuardConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n buildCommand: FieldDef.optional('string'),\n requireTextInPr: FieldDef.optional('string'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class PrMergeCleanupConfig extends BaseRuleConfig {\n mode?: OnOffMode;\n\n static readonly SCHEMA: SchemaShape<PrMergeCleanupConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class NoDirectMainUpdateConfig extends BaseRuleConfig {\n mode?: OnOffMode;\n\n static readonly SCHEMA: SchemaShape<NoDirectMainUpdateConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class NoEditOnMainConfig extends BaseRuleConfig {\n mode?: OnOffMode;\n branchNamingConvention?: string;\n\n static readonly SCHEMA: SchemaShape<NoEditOnMainConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n branchNamingConvention: FieldDef.optional('string'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class NoFileImportCyclesConfig extends BaseRuleConfig {\n mode?: OnOffMode;\n ignoreTypeOnly?: boolean;\n excludePackages?: string[];\n\n static readonly SCHEMA: SchemaShape<NoFileImportCyclesConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n ignoreTypeOnly: FieldDef.optional('boolean'),\n excludePackages: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class RuntimeArchitectureConfig extends BaseRuleConfig {\n mode?: OnOffMode;\n servicePaths?: string[];\n apiProjectPaths?: string[];\n allowedCycles?: string[];\n\n static readonly SCHEMA: SchemaShape<RuntimeArchitectureConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n servicePaths: FieldDef.optional('string[]'),\n apiProjectPaths: FieldDef.optional('string[]'),\n allowedCycles: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class NoJsFilesConfig extends BaseRuleConfig {\n mode?: OnOffMode;\n allowedPaths?: string[];\n\n static readonly SCHEMA: SchemaShape<NoJsFilesConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n allowedPaths: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n\nexport class ValidateTsInSrcConfig extends BaseRuleConfig {\n mode?: ValidateTsMode;\n allowedRootFiles?: string[];\n excludePaths?: string[];\n\n static readonly SCHEMA: SchemaShape<ValidateTsInSrcConfig> = {\n mode: new FieldDef('string', VALIDATE_TS_MODES),\n allowedRootFiles: FieldDef.optional('string[]'),\n excludePaths: FieldDef.optional('string[]'),\n ...BASE_RULE_SCHEMA,\n };\n}\n"]}
@@ -0,0 +1,6 @@
1
+ export interface SkipRuleResult {
2
+ skip: boolean;
3
+ reason?: string;
4
+ }
5
+ export declare function getCurrentBranch(): string;
6
+ export declare function shouldSkipRule(epoch: number | undefined, branchPattern: string | undefined): SkipRuleResult;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCurrentBranch = getCurrentBranch;
4
+ exports.shouldSkipRule = shouldSkipRule;
5
+ const child_process_1 = require("child_process");
6
+ const inform_ai_error_1 = require("./inform-ai-error");
7
+ const to_error_1 = require("./to-error");
8
+ function getCurrentBranch() {
9
+ const envBranch = process.env['BRANCH_NAME'] ||
10
+ process.env['GIT_BRANCH'] ||
11
+ process.env['GITHUB_HEAD_REF'] ||
12
+ process.env['GITHUB_REF_NAME'] ||
13
+ process.env['CI_COMMIT_BRANCH'] ||
14
+ process.env['CIRCLE_BRANCH'];
15
+ if (envBranch)
16
+ return envBranch;
17
+ // webpieces-disable no-unmanaged-exceptions -- rethrow as InformAiError so global catch surfaces readable message to AI
18
+ // eslint-disable-next-line @webpieces/no-unmanaged-exceptions -- rethrow as InformAiError so global catch surfaces readable message to AI
19
+ try {
20
+ return (0, child_process_1.execSync)('git rev-parse --abbrev-ref HEAD', { encoding: 'utf8' }).trim();
21
+ }
22
+ catch (err) {
23
+ const error = (0, to_error_1.toError)(err);
24
+ throw new inform_ai_error_1.InformAiError(`Failed to determine current git branch: ${error.message}`, { cause: error });
25
+ }
26
+ }
27
+ function shouldSkipRule(epoch, branchPattern) {
28
+ if (branchPattern) {
29
+ const current = getCurrentBranch();
30
+ if (current === branchPattern) {
31
+ return { skip: true, reason: `on branch "${branchPattern}"` };
32
+ }
33
+ }
34
+ if (epoch !== undefined) {
35
+ const nowSeconds = Date.now() / 1000;
36
+ if (nowSeconds < epoch) {
37
+ const expiresDate = new Date(epoch * 1000).toISOString().split('T')[0];
38
+ return { skip: true, reason: `ignoreModifiedUntilEpoch active, expires: ${expiresDate}` };
39
+ }
40
+ }
41
+ return { skip: false };
42
+ }
43
+ //# sourceMappingURL=skip-rule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skip-rule.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/skip-rule.ts"],"names":[],"mappings":";;AAeA,4CAiBC;AAED,wCAkBC;AApDD,iDAAyC;AAEzC,uDAAkD;AAClD,yCAAqC;AAYrC,SAAgB,gBAAgB;IAC5B,MAAM,SAAS,GACX,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACjC,IAAI,SAAS;QAAE,OAAO,SAAS,CAAC;IAChC,wHAAwH;IACxH,0IAA0I;IAC1I,IAAI,CAAC;QACD,OAAO,IAAA,wBAAQ,EAAC,iCAAiC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACpF,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACpB,MAAM,KAAK,GAAG,IAAA,kBAAO,EAAC,GAAG,CAAC,CAAC;QAC3B,MAAM,IAAI,+BAAa,CAAC,2CAA2C,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1G,CAAC;AACL,CAAC;AAED,SAAgB,cAAc,CAC1B,KAAyB,EACzB,aAAiC;IAEjC,IAAI,aAAa,EAAE,CAAC;QAChB,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;QACnC,IAAI,OAAO,KAAK,aAAa,EAAE,CAAC;YAC5B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,aAAa,GAAG,EAAE,CAAC;QAClE,CAAC;IACL,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACtB,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;QACrC,IAAI,UAAU,GAAG,KAAK,EAAE,CAAC;YACrB,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACvE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,6CAA6C,WAAW,EAAE,EAAE,CAAC;QAC9F,CAAC;IACL,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAC3B,CAAC","sourcesContent":["import { execSync } from 'child_process';\n\nimport { InformAiError } from './inform-ai-error';\nimport { toError } from './to-error';\n\n// Universal \"should this rule be skipped right now?\" logic, shared by code-rules,\n// ai-hook-rules and the Nx executors so every rule honors the same two escape\n// hatches: ignoreRuleWhileOnBranch (skip while on a named branch) and\n// ignoreModifiedUntilEpoch (skip until an epoch passes).\n\nexport interface SkipRuleResult {\n skip: boolean;\n reason?: string;\n}\n\nexport function getCurrentBranch(): string {\n const envBranch =\n process.env['BRANCH_NAME'] ||\n process.env['GIT_BRANCH'] ||\n process.env['GITHUB_HEAD_REF'] ||\n process.env['GITHUB_REF_NAME'] ||\n process.env['CI_COMMIT_BRANCH'] ||\n process.env['CIRCLE_BRANCH'];\n if (envBranch) return envBranch;\n // webpieces-disable no-unmanaged-exceptions -- rethrow as InformAiError so global catch surfaces readable message to AI\n // eslint-disable-next-line @webpieces/no-unmanaged-exceptions -- rethrow as InformAiError so global catch surfaces readable message to AI\n try {\n return execSync('git rev-parse --abbrev-ref HEAD', { encoding: 'utf8' }).trim();\n } catch (err: unknown) {\n const error = toError(err);\n throw new InformAiError(`Failed to determine current git branch: ${error.message}`, { cause: error });\n }\n}\n\nexport function shouldSkipRule(\n epoch: number | undefined,\n branchPattern: string | undefined\n): SkipRuleResult {\n if (branchPattern) {\n const current = getCurrentBranch();\n if (current === branchPattern) {\n return { skip: true, reason: `on branch \"${branchPattern}\"` };\n }\n }\n if (epoch !== undefined) {\n const nowSeconds = Date.now() / 1000;\n if (nowSeconds < epoch) {\n const expiresDate = new Date(epoch * 1000).toISOString().split('T')[0];\n return { skip: true, reason: `ignoreModifiedUntilEpoch active, expires: ${expiresDate}` };\n }\n }\n return { skip: false };\n}\n"]}
@@ -30,20 +30,32 @@ const RULE_SCHEMAS = {
30
30
  'no-js-files': rule_configs_1.NoJsFilesConfig.SCHEMA,
31
31
  'validate-ts-in-src': rule_configs_1.ValidateTsInSrcConfig.SCHEMA,
32
32
  };
33
+ function valueHint(def) {
34
+ return def.enumValues
35
+ ? `"${def.enumValues.join(' | ')}"`
36
+ : def.type === 'string[]' ? '["<string>", ...]'
37
+ : def.type === 'number' ? '<number>'
38
+ : def.type === 'boolean' ? '<boolean>'
39
+ : '"<string>"';
40
+ }
33
41
  function missingRuleSnippet(ruleName, schema) {
34
- const lines = Object.keys(schema).map(field => {
35
- const def = schema[field];
36
- const valueHint = def.enumValues
37
- ? `"${def.enumValues.join(' | ')}"`
38
- : def.type === 'string[]' ? '["<string>", ...]'
39
- : def.type === 'number' ? '<number>'
40
- : def.type === 'boolean' ? '<boolean>'
41
- : '"<string>"';
42
- return ` "${field}": ${valueHint}`;
43
- });
44
- return (`[${ruleName}] Not configured in webpieces.config.json. Add this entry to the "rules" section\n` +
42
+ // Only required fields go in the copy-paste entry. Optional fields (e.g. the
43
+ // universal escape hatches ignoreRuleWhileOnBranch / ignoreModifiedUntilEpoch)
44
+ // are listed separately so the snippet doesn't over-state what's mandatory.
45
+ const fields = Object.keys(schema);
46
+ const required = fields.filter(f => !schema[f].optional);
47
+ const optional = fields.filter(f => schema[f].optional);
48
+ const requiredLines = required.map(f => ` "${f}": ${valueHint(schema[f])}`);
49
+ let out = `[${ruleName}] Not configured in webpieces.config.json. Add this entry to the "rules" section\n` +
45
50
  `(choose values appropriate for your project):\n\n` +
46
- ` "${ruleName}": {\n${lines.join(',\n')}\n }`);
51
+ ` "${ruleName}": {\n${requiredLines.join(',\n')}\n }`;
52
+ if (optional.length > 0) {
53
+ const optionalLines = optional.map(f => ` "${f}": ${valueHint(schema[f])}`);
54
+ out +=
55
+ `\n\nOptional fields you may add to this rule (omit if not needed):\n` +
56
+ `${optionalLines.join(',\n')}`;
57
+ }
58
+ return out;
47
59
  }
48
60
  // webpieces-disable no-any-unknown -- rawRules values are opaque JSON; each field is validated individually
49
61
  function validateWebpiecesConfig(rawRules) {
@@ -1 +1 @@
1
- {"version":3,"file":"validate-config.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/validate-config.ts"],"names":[],"mappings":";;AA4EA,0DAoCC;AA/GD,iDAyBwB;AAExB,sEAAsE;AACtE,iEAAiE;AACjE,MAAM,YAAY,GAA6C;IAC3D,kBAAkB,EAAE,mCAAoB,CAAC,MAAM;IAC/C,gBAAgB,EAAE,iCAAkB,CAAC,MAAM;IAC3C,qBAAqB,EAAE,sCAAuB,CAAC,MAAM;IACrD,yBAAyB,EAAE,yCAA0B,CAAC,MAAM;IAC5D,gBAAgB,EAAE,iCAAkB,CAAC,MAAM;IAC3C,iBAAiB,EAAE,kCAAmB,CAAC,MAAM;IAC7C,sBAAsB,EAAE,uCAAwB,CAAC,MAAM;IACvD,kBAAkB,EAAE,oCAAqB,CAAC,MAAM;IAChD,gBAAgB,EAAE,kCAAmB,CAAC,MAAM;IAC5C,yBAAyB,EAAE,0CAA2B,CAAC,MAAM;IAC7D,qBAAqB,EAAE,sCAAuB,CAAC,MAAM;IACrD,sBAAsB,EAAE,uCAAwB,C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AK,GAAG,CAAC,CAAC;YACzF,CAAC;iBAAM,IAAI,QAAQ,CAAC,UAAU,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAe,CAAC,EAAE,CAAC;gBAC/E,MAAM,CAAC,IAAI,CAAC,IAAI,QAAQ,MAAM,GAAG,QAAQ,KAAK,mCAAmC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACxH,CAAC;QACL,CAAC;IACL,CAAC;IAED,0EAA0E;IAC1E,gFAAgF;IAChF,mEAAmE;IACnE,KAAK,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QAC5D,IAAI,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAAE,CAAC;YAC1B,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;QACtD,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["import { FieldDef } from './field-def';\nimport {\n MaxMethodLinesConfig,\n MaxFileLinesConfig,\n RequireReturnTypeConfig,\n NoInlineTypeLiteralsConfig,\n NoAnyUnknownConfig,\n NoImplicitAnyConfig,\n PrismaValidateDtosConfig,\n PrismaConverterConfig,\n NoDestructureConfig,\n NoUnmanagedExceptionsConfig,\n CatchErrorPatternConfig,\n ThrowCauseRequiredConfig,\n AngularNoDirectApiInResolverConfig,\n NoSymbolDiTokensConfig,\n NoShellSubstitutionConfig,\n BranchCreationGuardConfig,\n PrCreationGuardConfig,\n PrMergeCleanupConfig,\n NoDirectMainUpdateConfig,\n NoEditOnMainConfig,\n NoFileImportCyclesConfig,\n RuntimeArchitectureConfig,\n NoJsFilesConfig,\n ValidateTsInSrcConfig,\n} from './rule-configs';\n\n// Thin lookup table — each entry delegates to the class's own SCHEMA.\n// No field lists here; all schemas live with their config class.\nconst RULE_SCHEMAS: Record<string, Record<string, FieldDef>> = {\n 'max-method-lines': MaxMethodLinesConfig.SCHEMA,\n 'max-file-lines': MaxFileLinesConfig.SCHEMA,\n 'require-return-type': RequireReturnTypeConfig.SCHEMA,\n 'no-inline-type-literals': NoInlineTypeLiteralsConfig.SCHEMA,\n 'no-any-unknown': NoAnyUnknownConfig.SCHEMA,\n 'no-implicit-any': NoImplicitAnyConfig.SCHEMA,\n 'prisma-validate-dtos': PrismaValidateDtosConfig.SCHEMA,\n 'prisma-converter': PrismaConverterConfig.SCHEMA,\n 'no-destructure': NoDestructureConfig.SCHEMA,\n 'no-unmanaged-exceptions': NoUnmanagedExceptionsConfig.SCHEMA,\n 'catch-error-pattern': CatchErrorPatternConfig.SCHEMA,\n 'throw-cause-required': ThrowCauseRequiredConfig.SCHEMA,\n 'angular-no-direct-api-in-resolver': AngularNoDirectApiInResolverConfig.SCHEMA,\n 'no-symbol-di-tokens': NoSymbolDiTokensConfig.SCHEMA,\n 'no-shell-substitution': NoShellSubstitutionConfig.SCHEMA,\n 'branch-creation-guard': BranchCreationGuardConfig.SCHEMA,\n 'pr-creation-guard': PrCreationGuardConfig.SCHEMA,\n 'pr-merge-cleanup': PrMergeCleanupConfig.SCHEMA,\n 'no-direct-main-update': NoDirectMainUpdateConfig.SCHEMA,\n 'no-edit-on-main': NoEditOnMainConfig.SCHEMA,\n 'no-file-import-cycles': NoFileImportCyclesConfig.SCHEMA,\n 'runtime-architecture': RuntimeArchitectureConfig.SCHEMA,\n 'no-js-files': NoJsFilesConfig.SCHEMA,\n 'validate-ts-in-src': ValidateTsInSrcConfig.SCHEMA,\n};\n\nfunction missingRuleSnippet(ruleName: string, schema: Record<string, FieldDef>): string {\n const lines = Object.keys(schema).map(field => {\n const def = schema[field];\n const valueHint = def.enumValues\n ? `\"${def.enumValues.join(' | ')}\"`\n : def.type === 'string[]' ? '[\"<string>\", ...]'\n : def.type === 'number' ? '<number>'\n : def.type === 'boolean' ? '<boolean>'\n : '\"<string>\"';\n return ` \"${field}\": ${valueHint}`;\n });\n return (\n `[${ruleName}] Not configured in webpieces.config.json. Add this entry to the \"rules\" section\\n` +\n `(choose values appropriate for your project):\\n\\n` +\n ` \"${ruleName}\": {\\n${lines.join(',\\n')}\\n }`\n );\n}\n\n// webpieces-disable no-any-unknown -- rawRules values are opaque JSON; each field is validated individually\nexport function validateWebpiecesConfig(\n rawRules: Record<string, Record<string, unknown>>,\n): string[] {\n const errors: string[] = [];\n\n // Check field-level correctness for rules that are present\n for (const [ruleName, entry] of Object.entries(rawRules)) {\n const schema = RULE_SCHEMAS[ruleName];\n if (!schema) continue; // custom/unknown rule — no schema to validate against\n for (const [key, value] of Object.entries(entry)) {\n const fieldDef = schema[key];\n if (!fieldDef) {\n errors.push(`[${ruleName}] Unknown field \"${key}\". Valid fields: [${Object.keys(schema).join(', ')}]`);\n continue;\n }\n if (fieldDef.type === 'string[]') {\n if (!Array.isArray(value) || !value.every(v => typeof v === 'string'))\n errors.push(`[${ruleName}] \"${key}\" must be string[], got ${typeof value}.`);\n } else if (typeof value !== fieldDef.type) {\n errors.push(`[${ruleName}] \"${key}\" must be ${fieldDef.type}, got ${typeof value}.`);\n } else if (fieldDef.enumValues && !fieldDef.enumValues.includes(value as string)) {\n errors.push(`[${ruleName}] \"${key}\" = \"${value}\" is not valid. Must be one of: ${fieldDef.enumValues.join(', ')}.`);\n }\n }\n }\n\n // Every built-in rule must be explicitly configured — no silent defaults.\n // When a new rule is added to the framework, this check surfaces it immediately\n // with a ready-to-copy snippet so AI can configure it in one pass.\n for (const [ruleName, schema] of Object.entries(RULE_SCHEMAS)) {\n if (!(ruleName in rawRules)) {\n errors.push(missingRuleSnippet(ruleName, schema));\n }\n }\n\n return errors;\n}\n"]}
1
+ {"version":3,"file":"validate-config.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/validate-config.ts"],"names":[],"mappings":";;AA0FA,0DAoCC;AA7HD,iDAyBwB;AAExB,sEAAsE;AACtE,iEA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UAAU,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAe,CAAC,EAAE,CAAC;gBAC/E,MAAM,CAAC,IAAI,CAAC,IAAI,QAAQ,MAAM,GAAG,QAAQ,KAAK,mCAAmC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACxH,CAAC;QACL,CAAC;IACL,CAAC;IAED,0EAA0E;IAC1E,gFAAgF;IAChF,mEAAmE;IACnE,KAAK,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QAC5D,IAAI,CAAC,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAAE,CAAC;YAC1B,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;QACtD,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["import { FieldDef } from './field-def';\nimport {\n MaxMethodLinesConfig,\n MaxFileLinesConfig,\n RequireReturnTypeConfig,\n NoInlineTypeLiteralsConfig,\n NoAnyUnknownConfig,\n NoImplicitAnyConfig,\n PrismaValidateDtosConfig,\n PrismaConverterConfig,\n NoDestructureConfig,\n NoUnmanagedExceptionsConfig,\n CatchErrorPatternConfig,\n ThrowCauseRequiredConfig,\n AngularNoDirectApiInResolverConfig,\n NoSymbolDiTokensConfig,\n NoShellSubstitutionConfig,\n BranchCreationGuardConfig,\n PrCreationGuardConfig,\n PrMergeCleanupConfig,\n NoDirectMainUpdateConfig,\n NoEditOnMainConfig,\n NoFileImportCyclesConfig,\n RuntimeArchitectureConfig,\n NoJsFilesConfig,\n ValidateTsInSrcConfig,\n} from './rule-configs';\n\n// Thin lookup table — each entry delegates to the class's own SCHEMA.\n// No field lists here; all schemas live with their config class.\nconst RULE_SCHEMAS: Record<string, Record<string, FieldDef>> = {\n 'max-method-lines': MaxMethodLinesConfig.SCHEMA,\n 'max-file-lines': MaxFileLinesConfig.SCHEMA,\n 'require-return-type': RequireReturnTypeConfig.SCHEMA,\n 'no-inline-type-literals': NoInlineTypeLiteralsConfig.SCHEMA,\n 'no-any-unknown': NoAnyUnknownConfig.SCHEMA,\n 'no-implicit-any': NoImplicitAnyConfig.SCHEMA,\n 'prisma-validate-dtos': PrismaValidateDtosConfig.SCHEMA,\n 'prisma-converter': PrismaConverterConfig.SCHEMA,\n 'no-destructure': NoDestructureConfig.SCHEMA,\n 'no-unmanaged-exceptions': NoUnmanagedExceptionsConfig.SCHEMA,\n 'catch-error-pattern': CatchErrorPatternConfig.SCHEMA,\n 'throw-cause-required': ThrowCauseRequiredConfig.SCHEMA,\n 'angular-no-direct-api-in-resolver': AngularNoDirectApiInResolverConfig.SCHEMA,\n 'no-symbol-di-tokens': NoSymbolDiTokensConfig.SCHEMA,\n 'no-shell-substitution': NoShellSubstitutionConfig.SCHEMA,\n 'branch-creation-guard': BranchCreationGuardConfig.SCHEMA,\n 'pr-creation-guard': PrCreationGuardConfig.SCHEMA,\n 'pr-merge-cleanup': PrMergeCleanupConfig.SCHEMA,\n 'no-direct-main-update': NoDirectMainUpdateConfig.SCHEMA,\n 'no-edit-on-main': NoEditOnMainConfig.SCHEMA,\n 'no-file-import-cycles': NoFileImportCyclesConfig.SCHEMA,\n 'runtime-architecture': RuntimeArchitectureConfig.SCHEMA,\n 'no-js-files': NoJsFilesConfig.SCHEMA,\n 'validate-ts-in-src': ValidateTsInSrcConfig.SCHEMA,\n};\n\nfunction valueHint(def: FieldDef): string {\n return def.enumValues\n ? `\"${def.enumValues.join(' | ')}\"`\n : def.type === 'string[]' ? '[\"<string>\", ...]'\n : def.type === 'number' ? '<number>'\n : def.type === 'boolean' ? '<boolean>'\n : '\"<string>\"';\n}\n\nfunction missingRuleSnippet(ruleName: string, schema: Record<string, FieldDef>): string {\n // Only required fields go in the copy-paste entry. Optional fields (e.g. the\n // universal escape hatches ignoreRuleWhileOnBranch / ignoreModifiedUntilEpoch)\n // are listed separately so the snippet doesn't over-state what's mandatory.\n const fields = Object.keys(schema);\n const required = fields.filter(f => !schema[f].optional);\n const optional = fields.filter(f => schema[f].optional);\n\n const requiredLines = required.map(f => ` \"${f}\": ${valueHint(schema[f])}`);\n let out =\n `[${ruleName}] Not configured in webpieces.config.json. Add this entry to the \"rules\" section\\n` +\n `(choose values appropriate for your project):\\n\\n` +\n ` \"${ruleName}\": {\\n${requiredLines.join(',\\n')}\\n }`;\n\n if (optional.length > 0) {\n const optionalLines = optional.map(f => ` \"${f}\": ${valueHint(schema[f])}`);\n out +=\n `\\n\\nOptional fields you may add to this rule (omit if not needed):\\n` +\n `${optionalLines.join(',\\n')}`;\n }\n return out;\n}\n\n// webpieces-disable no-any-unknown -- rawRules values are opaque JSON; each field is validated individually\nexport function validateWebpiecesConfig(\n rawRules: Record<string, Record<string, unknown>>,\n): string[] {\n const errors: string[] = [];\n\n // Check field-level correctness for rules that are present\n for (const [ruleName, entry] of Object.entries(rawRules)) {\n const schema = RULE_SCHEMAS[ruleName];\n if (!schema) continue; // custom/unknown rule — no schema to validate against\n for (const [key, value] of Object.entries(entry)) {\n const fieldDef = schema[key];\n if (!fieldDef) {\n errors.push(`[${ruleName}] Unknown field \"${key}\". Valid fields: [${Object.keys(schema).join(', ')}]`);\n continue;\n }\n if (fieldDef.type === 'string[]') {\n if (!Array.isArray(value) || !value.every(v => typeof v === 'string'))\n errors.push(`[${ruleName}] \"${key}\" must be string[], got ${typeof value}.`);\n } else if (typeof value !== fieldDef.type) {\n errors.push(`[${ruleName}] \"${key}\" must be ${fieldDef.type}, got ${typeof value}.`);\n } else if (fieldDef.enumValues && !fieldDef.enumValues.includes(value as string)) {\n errors.push(`[${ruleName}] \"${key}\" = \"${value}\" is not valid. Must be one of: ${fieldDef.enumValues.join(', ')}.`);\n }\n }\n }\n\n // Every built-in rule must be explicitly configured — no silent defaults.\n // When a new rule is added to the framework, this check surfaces it immediately\n // with a ready-to-copy snippet so AI can configure it in one pass.\n for (const [ruleName, schema] of Object.entries(RULE_SCHEMAS)) {\n if (!(ruleName in rawRules)) {\n errors.push(missingRuleSnippet(ruleName, schema));\n }\n }\n\n return errors;\n}\n"]}