@webpieces/code-rules 0.4.943 → 0.4.945

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/code-rules",
3
- "version": "0.4.943",
3
+ "version": "0.4.945",
4
4
  "description": "Standalone code validation rules extracted from architecture-validators, no Nx dependency required",
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
@@ -16,19 +16,19 @@
16
16
  "directory": "packages/tooling/code-rules"
17
17
  },
18
18
  "dependencies": {
19
- "@webpieces/rules-config": "0.4.943",
19
+ "@webpieces/rules-config": "0.4.945",
20
20
  "@inversifyjs/binding-decorators": "1.1.5",
21
21
  "inversify": "7.10.4",
22
22
  "reflect-metadata": "0.2.2",
23
- "@webpieces/tooling-common": "0.4.943",
24
- "@webpieces/repo-workflow-core": "0.4.943",
25
- "@webpieces/rules-sdk": "0.4.943"
23
+ "@webpieces/tooling-common": "0.4.945",
24
+ "@webpieces/repo-workflow-core": "0.4.945",
25
+ "@webpieces/rules-sdk": "0.4.945"
26
26
  },
27
27
  "publishConfig": {
28
28
  "access": "public"
29
29
  },
30
30
  "devDependencies": {
31
- "@webpieces/tooling-testkit": "0.4.943"
31
+ "@webpieces/tooling-testkit": "0.4.945"
32
32
  },
33
33
  "exports": {
34
34
  ".": "./src/index.js",
@@ -41,6 +41,7 @@ const api_lib_spelling_configs_1 = require("./configs/api-lib-spelling-configs")
41
41
  const no_utility_types_config_1 = require("./configs/no-utility-types-config");
42
42
  const required_type_suffix_config_1 = require("./configs/required-type-suffix-config");
43
43
  const tag_truth_configs_1 = require("./configs/tag-truth-configs");
44
+ const catch_must_propagate_config_1 = require("./configs/catch-must-propagate-config");
44
45
  class CodePolicy {
45
46
  configClass;
46
47
  ruleId;
@@ -67,6 +68,7 @@ exports.CODE_POLICIES = [
67
68
  new CodePolicy(rule_configs_1.NoDestructureConfig, 'no-destructure', async () => (await Promise.resolve().then(() => __importStar(require('./validate-no-destructure')))).NoDestructureValidator, rule_configs_1.NoDestructureConfig.SCHEMA),
68
69
  new CodePolicy(rule_configs_1.CatchErrorPatternConfig, 'catch-error-pattern', async () => (await Promise.resolve().then(() => __importStar(require('./validate-catch-error-pattern')))).CatchErrorPatternValidator, rule_configs_1.CatchErrorPatternConfig.SCHEMA),
69
70
  new CodePolicy(rule_configs_1.NoUnmanagedExceptionsConfig, 'no-unmanaged-exceptions', async () => (await Promise.resolve().then(() => __importStar(require('./validate-no-unmanaged-exceptions')))).NoUnmanagedExceptionsValidator, rule_configs_1.NoUnmanagedExceptionsConfig.SCHEMA),
71
+ new CodePolicy(catch_must_propagate_config_1.CatchMustPropagateConfig, 'catch-must-propagate', async () => (await Promise.resolve().then(() => __importStar(require('./validate-catch-must-propagate')))).CatchMustPropagateValidator, catch_must_propagate_config_1.CatchMustPropagateConfig.SCHEMA),
70
72
  new CodePolicy(rule_configs_1.AngularNoDirectApiInResolverConfig, 'angular-no-direct-api-in-resolver', async () => (await Promise.resolve().then(() => __importStar(require('./validate-no-direct-api-resolver')))).NoDirectApiResolverValidator, rule_configs_1.AngularNoDirectApiInResolverConfig.SCHEMA),
71
73
  new CodePolicy(rule_configs_1.NoSymbolDiTokensConfig, 'no-symbol-di-tokens', async () => (await Promise.resolve().then(() => __importStar(require('./validate-no-symbol-di-tokens')))).NoSymbolDiTokensValidator, rule_configs_1.NoSymbolDiTokensConfig.SCHEMA),
72
74
  new CodePolicy(no_client_creation_config_1.NoClientCreationOutsideServerOrClientConfig, 'no-client-creation-outside-server-or-client', async () => (await Promise.resolve().then(() => __importStar(require('./validate-no-client-creation-outside-server-or-client'))))
@@ -1 +1 @@
1
- {"version":3,"file":"code-policy-registry.js","sourceRoot":"","sources":["../../../../../packages/tooling/code-rules/src/code-policy-registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yDAqBgC;AAChC,mFAAkG;AAClG,2EA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CAAC,CAAC,wDAAa,iCAAiC,GAAC,CAAC,CAAC,0BAA0B,EACxF,sCAAuB,CAAC,MAAM,CACjC;IACD,IAAI,UAAU,CACV,uDAA4B,EAC5B,6BAA6B,EAC7B,KAAK,IAAI,EAAE,CACP,CAAC,wDAAa,wCAAwC,GAAC,CAAC;SACnD,+BAA+B,EACxC,uDAA4B,CAAC,MAAM,CACtC;IACD,IAAI,UAAU,CACV,wDAA6B,EAC7B,8BAA8B,EAC9B,KAAK,IAAI,EAAE,CACP,CAAC,wDAAa,yCAAyC,GAAC,CAAC;SACpD,gCAAgC,EACzC,wDAA6B,CAAC,MAAM,CACvC;IACD,IAAI,UAAU,CACV,sDAA4B,EAC5B,6BAA6B,EAC7B,KAAK,IAAI,EAAE,CACP,CAAC,wDAAa,wCAAwC,GAAC,CAAC;SACnD,+BAA+B,EACxC,sDAA4B,CAAC,MAAM,CACtC;IACD,IAAI,UAAU,CACV,sDAAwB,EACxB,sBAAsB,EACtB,KAAK,IAAI,EAAE,CAAC,CAAC,wDAAa,iCAAiC,GAAC,CAAC,CAAC,2BAA2B,EACzF,sDAAwB,CAAC,MAAM,CAClC;IACD,IAAI,UAAU,CACV,2CAAuB,EACvB,oBAAoB,EACpB,KAAK,IAAI,EAAE,CAAC,CAAC,wDAAa,+BAA+B,GAAC,CAAC,CAAC,0BAA0B,EACtF,2CAAuB,CAAC,MAAM,CACjC;IACD,IAAI,UAAU,CACV,2CAAuB,EACvB,oBAAoB,EACpB,KAAK,IAAI,EAAE,CAAC,CAAC,wDAAa,+BAA+B,GAAC,CAAC,CAAC,0BAA0B,EACtF,2CAAuB,CAAC,MAAM,CACjC;CACJ,CAAC","sourcesContent":["import { BaseRuleConfig, FieldDef, BuildPolicy } from '@webpieces/rules-sdk';\nimport {\n MaxMethodLinesConfig,\n MaxFileLinesConfig,\n RequireReturnTypeConfig,\n NoInlineTypeLiteralsConfig,\n NoAnyUnknownConfig,\n NoImplicitAnyConfig,\n PrismaValidateDtosConfig,\n PrismaConverterConfig,\n NoDestructureConfig,\n CatchErrorPatternConfig,\n NoUnmanagedExceptionsConfig,\n AngularNoDirectApiInResolverConfig,\n NoSymbolDiTokensConfig,\n NoCustomCssConfig,\n NoProcessExitOutsideMainConfig,\n NoFunctionOutsideClassConfig,\n InjectAnnotationNotNeededForConcreteClassConfig,\n FrameworkTagConfig,\n RoleTagConfig,\n EnsureWeAreSecureConfig,\n} from './configs/rule-configs';\nimport { NoClientCreationOutsideServerOrClientConfig } from './configs/no-client-creation-config';\nimport { NoStatePathsInTemplatesConfig } from './configs/no-state-paths-config';\nimport {\n NoInlineImportInApiLibConfig,\n OneEnumSpellingInApiLibConfig,\n} from './configs/api-lib-spelling-configs';\nimport { NoUtilityTypesInApiLibConfig } from './configs/no-utility-types-config';\nimport { RequiredTypeSuffixConfig } from './configs/required-type-suffix-config';\nimport { FrameworkTsconfigConfig, FrameworkPackagesConfig } from './configs/tag-truth-configs';\n\n/** The owner entry declares both its schema token and executable validator. */\nexport type ConfigCtor = new () => BaseRuleConfig;\n\nexport type ValidatorCtor = new (...args: never[]) => BuildPolicy;\n\nexport class CodePolicy {\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n readonly configClass: ConfigCtor,\n readonly ruleId: string,\n readonly loadValidator: () => Promise<ValidatorCtor>,\n readonly schema: Readonly<Record<string, FieldDef>>,\n ) {}\n}\n\nexport const CODE_POLICIES: readonly CodePolicy[] = [\n new CodePolicy(\n MaxMethodLinesConfig,\n 'max-method-lines',\n async () => (await import('./validate-modified-methods')).MaxMethodLinesValidator,\n MaxMethodLinesConfig.SCHEMA,\n ),\n new CodePolicy(\n MaxFileLinesConfig,\n 'max-file-lines',\n async () => (await import('./validate-modified-files')).MaxFileLinesValidator,\n MaxFileLinesConfig.SCHEMA,\n ),\n new CodePolicy(\n RequireReturnTypeConfig,\n 'require-return-type',\n async () => (await import('./validate-return-types')).RequireReturnTypeValidator,\n RequireReturnTypeConfig.SCHEMA,\n ),\n new CodePolicy(\n NoInlineTypeLiteralsConfig,\n 'no-inline-type-literals',\n async () => (await import('./validate-no-inline-types')).NoInlineTypeLiteralsValidator,\n NoInlineTypeLiteralsConfig.SCHEMA,\n ),\n new CodePolicy(\n NoAnyUnknownConfig,\n 'no-any-unknown',\n async () => (await import('./validate-no-any-unknown')).NoAnyUnknownValidator,\n NoAnyUnknownConfig.SCHEMA,\n ),\n new CodePolicy(\n NoImplicitAnyConfig,\n 'no-implicit-any',\n async () => (await import('./validate-no-implicit-any')).NoImplicitAnyValidator,\n NoImplicitAnyConfig.SCHEMA,\n ),\n new CodePolicy(\n PrismaValidateDtosConfig,\n 'prisma-validate-dtos',\n async () => (await import('./validate-dtos')).PrismaValidateDtosValidator,\n PrismaValidateDtosConfig.SCHEMA,\n ),\n new CodePolicy(\n PrismaConverterConfig,\n 'prisma-converter',\n async () => (await import('./validate-prisma-converters')).PrismaConverterValidator,\n PrismaConverterConfig.SCHEMA,\n ),\n new CodePolicy(\n NoDestructureConfig,\n 'no-destructure',\n async () => (await import('./validate-no-destructure')).NoDestructureValidator,\n NoDestructureConfig.SCHEMA,\n ),\n new CodePolicy(\n CatchErrorPatternConfig,\n 'catch-error-pattern',\n async () => (await import('./validate-catch-error-pattern')).CatchErrorPatternValidator,\n CatchErrorPatternConfig.SCHEMA,\n ),\n new CodePolicy(\n NoUnmanagedExceptionsConfig,\n 'no-unmanaged-exceptions',\n async () =>\n (await import('./validate-no-unmanaged-exceptions')).NoUnmanagedExceptionsValidator,\n NoUnmanagedExceptionsConfig.SCHEMA,\n ),\n new CodePolicy(\n AngularNoDirectApiInResolverConfig,\n 'angular-no-direct-api-in-resolver',\n async () =>\n (await import('./validate-no-direct-api-resolver')).NoDirectApiResolverValidator,\n AngularNoDirectApiInResolverConfig.SCHEMA,\n ),\n new CodePolicy(\n NoSymbolDiTokensConfig,\n 'no-symbol-di-tokens',\n async () => (await import('./validate-no-symbol-di-tokens')).NoSymbolDiTokensValidator,\n NoSymbolDiTokensConfig.SCHEMA,\n ),\n new CodePolicy(\n NoClientCreationOutsideServerOrClientConfig,\n 'no-client-creation-outside-server-or-client',\n async () =>\n (await import('./validate-no-client-creation-outside-server-or-client'))\n .NoClientCreationOutsideServerOrClientValidator,\n NoClientCreationOutsideServerOrClientConfig.SCHEMA,\n ),\n new CodePolicy(\n NoCustomCssConfig,\n 'no-custom-css',\n async () => (await import('./validate-no-custom-css')).NoCustomCssValidator,\n NoCustomCssConfig.SCHEMA,\n ),\n new CodePolicy(\n NoStatePathsInTemplatesConfig,\n 'no-state-paths-in-templates',\n async () =>\n (await import('./validate-no-state-paths-in-templates'))\n .NoStatePathsInTemplatesValidator,\n NoStatePathsInTemplatesConfig.SCHEMA,\n ),\n new CodePolicy(\n NoProcessExitOutsideMainConfig,\n 'no-process-exit-outside-main',\n async () =>\n (await import('./validate-no-process-exit-outside-main'))\n .NoProcessExitOutsideMainValidator,\n NoProcessExitOutsideMainConfig.SCHEMA,\n ),\n new CodePolicy(\n NoFunctionOutsideClassConfig,\n 'no-function-outside-class',\n async () =>\n (await import('./validate-no-function-outside-class')).NoFunctionOutsideClassValidator,\n NoFunctionOutsideClassConfig.SCHEMA,\n ),\n new CodePolicy(\n InjectAnnotationNotNeededForConcreteClassConfig,\n 'inject-annotation-not-needed-for-concrete-class',\n async () =>\n (await import('./validate-inject-annotation-not-needed-for-concrete-class'))\n .InjectAnnotationNotNeededForConcreteClassValidator,\n InjectAnnotationNotNeededForConcreteClassConfig.SCHEMA,\n ),\n new CodePolicy(\n FrameworkTagConfig,\n 'framework-tag',\n async () => (await import('./validate-framework-tag')).FrameworkTagValidator,\n FrameworkTagConfig.SCHEMA,\n ),\n new CodePolicy(\n RoleTagConfig,\n 'role-tag',\n async () => (await import('./validate-role-tag')).RoleTagValidator,\n RoleTagConfig.SCHEMA,\n ),\n new CodePolicy(\n EnsureWeAreSecureConfig,\n 'ensure-we-are-secure',\n async () => (await import('./validate-ensure-we-are-secure')).EnsureWeAreSecureValidator,\n EnsureWeAreSecureConfig.SCHEMA,\n ),\n new CodePolicy(\n NoInlineImportInApiLibConfig,\n 'no-inline-import-in-api-lib',\n async () =>\n (await import('./validate-no-inline-import-in-api-lib'))\n .NoInlineImportInApiLibValidator,\n NoInlineImportInApiLibConfig.SCHEMA,\n ),\n new CodePolicy(\n OneEnumSpellingInApiLibConfig,\n 'one-enum-spelling-in-api-lib',\n async () =>\n (await import('./validate-one-enum-spelling-in-api-lib'))\n .OneEnumSpellingInApiLibValidator,\n OneEnumSpellingInApiLibConfig.SCHEMA,\n ),\n new CodePolicy(\n NoUtilityTypesInApiLibConfig,\n 'no-utility-types-in-api-lib',\n async () =>\n (await import('./validate-no-utility-types-in-api-lib'))\n .NoUtilityTypesInApiLibValidator,\n NoUtilityTypesInApiLibConfig.SCHEMA,\n ),\n new CodePolicy(\n RequiredTypeSuffixConfig,\n 'required-type-suffix',\n async () => (await import('./validate-required-type-suffix')).RequiredTypeSuffixValidator,\n RequiredTypeSuffixConfig.SCHEMA,\n ),\n new CodePolicy(\n FrameworkTsconfigConfig,\n 'framework-tsconfig',\n async () => (await import('./validate-framework-tsconfig')).FrameworkTsconfigValidator,\n FrameworkTsconfigConfig.SCHEMA,\n ),\n new CodePolicy(\n FrameworkPackagesConfig,\n 'framework-packages',\n async () => (await import('./validate-framework-packages')).FrameworkPackagesValidator,\n FrameworkPackagesConfig.SCHEMA,\n ),\n];\n"]}
1
+ {"version":3,"file":"code-policy-registry.js","sourceRoot":"","sources":["../../../../../packages/tooling/code-rules/src/code-policy-registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yDAqBgC;AAChC,mFAAkG;AAClG,2EAAgF;AAChF,iFAG4C;AAC5C,+EAAiF;AACjF,uFAAiF;AACjF,mEAA+F;AAC/F,uFAAiF;AAOjF,MAAa,UAAU;IAGN;IACA;IACA;IACA;IALb,yDAAyD;IACzD,YACa,WAAuB,EACvB,MAAc,EACd,aAA2C,EAC3C,MAA0C;QAH1C,gB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GAAC,CAAC,CAAC,0BAA0B,EACxF,sCAAuB,CAAC,MAAM,CACjC;IACD,IAAI,UAAU,CACV,uDAA4B,EAC5B,6BAA6B,EAC7B,KAAK,IAAI,EAAE,CACP,CAAC,wDAAa,wCAAwC,GAAC,CAAC;SACnD,+BAA+B,EACxC,uDAA4B,CAAC,MAAM,CACtC;IACD,IAAI,UAAU,CACV,wDAA6B,EAC7B,8BAA8B,EAC9B,KAAK,IAAI,EAAE,CACP,CAAC,wDAAa,yCAAyC,GAAC,CAAC;SACpD,gCAAgC,EACzC,wDAA6B,CAAC,MAAM,CACvC;IACD,IAAI,UAAU,CACV,sDAA4B,EAC5B,6BAA6B,EAC7B,KAAK,IAAI,EAAE,CACP,CAAC,wDAAa,wCAAwC,GAAC,CAAC;SACnD,+BAA+B,EACxC,sDAA4B,CAAC,MAAM,CACtC;IACD,IAAI,UAAU,CACV,sDAAwB,EACxB,sBAAsB,EACtB,KAAK,IAAI,EAAE,CAAC,CAAC,wDAAa,iCAAiC,GAAC,CAAC,CAAC,2BAA2B,EACzF,sDAAwB,CAAC,MAAM,CAClC;IACD,IAAI,UAAU,CACV,2CAAuB,EACvB,oBAAoB,EACpB,KAAK,IAAI,EAAE,CAAC,CAAC,wDAAa,+BAA+B,GAAC,CAAC,CAAC,0BAA0B,EACtF,2CAAuB,CAAC,MAAM,CACjC;IACD,IAAI,UAAU,CACV,2CAAuB,EACvB,oBAAoB,EACpB,KAAK,IAAI,EAAE,CAAC,CAAC,wDAAa,+BAA+B,GAAC,CAAC,CAAC,0BAA0B,EACtF,2CAAuB,CAAC,MAAM,CACjC;CACJ,CAAC","sourcesContent":["import { BaseRuleConfig, FieldDef, BuildPolicy } from '@webpieces/rules-sdk';\nimport {\n MaxMethodLinesConfig,\n MaxFileLinesConfig,\n RequireReturnTypeConfig,\n NoInlineTypeLiteralsConfig,\n NoAnyUnknownConfig,\n NoImplicitAnyConfig,\n PrismaValidateDtosConfig,\n PrismaConverterConfig,\n NoDestructureConfig,\n CatchErrorPatternConfig,\n NoUnmanagedExceptionsConfig,\n AngularNoDirectApiInResolverConfig,\n NoSymbolDiTokensConfig,\n NoCustomCssConfig,\n NoProcessExitOutsideMainConfig,\n NoFunctionOutsideClassConfig,\n InjectAnnotationNotNeededForConcreteClassConfig,\n FrameworkTagConfig,\n RoleTagConfig,\n EnsureWeAreSecureConfig,\n} from './configs/rule-configs';\nimport { NoClientCreationOutsideServerOrClientConfig } from './configs/no-client-creation-config';\nimport { NoStatePathsInTemplatesConfig } from './configs/no-state-paths-config';\nimport {\n NoInlineImportInApiLibConfig,\n OneEnumSpellingInApiLibConfig,\n} from './configs/api-lib-spelling-configs';\nimport { NoUtilityTypesInApiLibConfig } from './configs/no-utility-types-config';\nimport { RequiredTypeSuffixConfig } from './configs/required-type-suffix-config';\nimport { FrameworkTsconfigConfig, FrameworkPackagesConfig } from './configs/tag-truth-configs';\nimport { CatchMustPropagateConfig } from './configs/catch-must-propagate-config';\n\n/** The owner entry declares both its schema token and executable validator. */\nexport type ConfigCtor = new () => BaseRuleConfig;\n\nexport type ValidatorCtor = new (...args: never[]) => BuildPolicy;\n\nexport class CodePolicy {\n // eslint-disable-next-line @typescript-eslint/max-params\n constructor(\n readonly configClass: ConfigCtor,\n readonly ruleId: string,\n readonly loadValidator: () => Promise<ValidatorCtor>,\n readonly schema: Readonly<Record<string, FieldDef>>,\n ) {}\n}\n\nexport const CODE_POLICIES: readonly CodePolicy[] = [\n new CodePolicy(\n MaxMethodLinesConfig,\n 'max-method-lines',\n async () => (await import('./validate-modified-methods')).MaxMethodLinesValidator,\n MaxMethodLinesConfig.SCHEMA,\n ),\n new CodePolicy(\n MaxFileLinesConfig,\n 'max-file-lines',\n async () => (await import('./validate-modified-files')).MaxFileLinesValidator,\n MaxFileLinesConfig.SCHEMA,\n ),\n new CodePolicy(\n RequireReturnTypeConfig,\n 'require-return-type',\n async () => (await import('./validate-return-types')).RequireReturnTypeValidator,\n RequireReturnTypeConfig.SCHEMA,\n ),\n new CodePolicy(\n NoInlineTypeLiteralsConfig,\n 'no-inline-type-literals',\n async () => (await import('./validate-no-inline-types')).NoInlineTypeLiteralsValidator,\n NoInlineTypeLiteralsConfig.SCHEMA,\n ),\n new CodePolicy(\n NoAnyUnknownConfig,\n 'no-any-unknown',\n async () => (await import('./validate-no-any-unknown')).NoAnyUnknownValidator,\n NoAnyUnknownConfig.SCHEMA,\n ),\n new CodePolicy(\n NoImplicitAnyConfig,\n 'no-implicit-any',\n async () => (await import('./validate-no-implicit-any')).NoImplicitAnyValidator,\n NoImplicitAnyConfig.SCHEMA,\n ),\n new CodePolicy(\n PrismaValidateDtosConfig,\n 'prisma-validate-dtos',\n async () => (await import('./validate-dtos')).PrismaValidateDtosValidator,\n PrismaValidateDtosConfig.SCHEMA,\n ),\n new CodePolicy(\n PrismaConverterConfig,\n 'prisma-converter',\n async () => (await import('./validate-prisma-converters')).PrismaConverterValidator,\n PrismaConverterConfig.SCHEMA,\n ),\n new CodePolicy(\n NoDestructureConfig,\n 'no-destructure',\n async () => (await import('./validate-no-destructure')).NoDestructureValidator,\n NoDestructureConfig.SCHEMA,\n ),\n new CodePolicy(\n CatchErrorPatternConfig,\n 'catch-error-pattern',\n async () => (await import('./validate-catch-error-pattern')).CatchErrorPatternValidator,\n CatchErrorPatternConfig.SCHEMA,\n ),\n new CodePolicy(\n NoUnmanagedExceptionsConfig,\n 'no-unmanaged-exceptions',\n async () =>\n (await import('./validate-no-unmanaged-exceptions')).NoUnmanagedExceptionsValidator,\n NoUnmanagedExceptionsConfig.SCHEMA,\n ),\n new CodePolicy(\n CatchMustPropagateConfig,\n 'catch-must-propagate',\n async () => (await import('./validate-catch-must-propagate')).CatchMustPropagateValidator,\n CatchMustPropagateConfig.SCHEMA,\n ),\n new CodePolicy(\n AngularNoDirectApiInResolverConfig,\n 'angular-no-direct-api-in-resolver',\n async () =>\n (await import('./validate-no-direct-api-resolver')).NoDirectApiResolverValidator,\n AngularNoDirectApiInResolverConfig.SCHEMA,\n ),\n new CodePolicy(\n NoSymbolDiTokensConfig,\n 'no-symbol-di-tokens',\n async () => (await import('./validate-no-symbol-di-tokens')).NoSymbolDiTokensValidator,\n NoSymbolDiTokensConfig.SCHEMA,\n ),\n new CodePolicy(\n NoClientCreationOutsideServerOrClientConfig,\n 'no-client-creation-outside-server-or-client',\n async () =>\n (await import('./validate-no-client-creation-outside-server-or-client'))\n .NoClientCreationOutsideServerOrClientValidator,\n NoClientCreationOutsideServerOrClientConfig.SCHEMA,\n ),\n new CodePolicy(\n NoCustomCssConfig,\n 'no-custom-css',\n async () => (await import('./validate-no-custom-css')).NoCustomCssValidator,\n NoCustomCssConfig.SCHEMA,\n ),\n new CodePolicy(\n NoStatePathsInTemplatesConfig,\n 'no-state-paths-in-templates',\n async () =>\n (await import('./validate-no-state-paths-in-templates'))\n .NoStatePathsInTemplatesValidator,\n NoStatePathsInTemplatesConfig.SCHEMA,\n ),\n new CodePolicy(\n NoProcessExitOutsideMainConfig,\n 'no-process-exit-outside-main',\n async () =>\n (await import('./validate-no-process-exit-outside-main'))\n .NoProcessExitOutsideMainValidator,\n NoProcessExitOutsideMainConfig.SCHEMA,\n ),\n new CodePolicy(\n NoFunctionOutsideClassConfig,\n 'no-function-outside-class',\n async () =>\n (await import('./validate-no-function-outside-class')).NoFunctionOutsideClassValidator,\n NoFunctionOutsideClassConfig.SCHEMA,\n ),\n new CodePolicy(\n InjectAnnotationNotNeededForConcreteClassConfig,\n 'inject-annotation-not-needed-for-concrete-class',\n async () =>\n (await import('./validate-inject-annotation-not-needed-for-concrete-class'))\n .InjectAnnotationNotNeededForConcreteClassValidator,\n InjectAnnotationNotNeededForConcreteClassConfig.SCHEMA,\n ),\n new CodePolicy(\n FrameworkTagConfig,\n 'framework-tag',\n async () => (await import('./validate-framework-tag')).FrameworkTagValidator,\n FrameworkTagConfig.SCHEMA,\n ),\n new CodePolicy(\n RoleTagConfig,\n 'role-tag',\n async () => (await import('./validate-role-tag')).RoleTagValidator,\n RoleTagConfig.SCHEMA,\n ),\n new CodePolicy(\n EnsureWeAreSecureConfig,\n 'ensure-we-are-secure',\n async () => (await import('./validate-ensure-we-are-secure')).EnsureWeAreSecureValidator,\n EnsureWeAreSecureConfig.SCHEMA,\n ),\n new CodePolicy(\n NoInlineImportInApiLibConfig,\n 'no-inline-import-in-api-lib',\n async () =>\n (await import('./validate-no-inline-import-in-api-lib'))\n .NoInlineImportInApiLibValidator,\n NoInlineImportInApiLibConfig.SCHEMA,\n ),\n new CodePolicy(\n OneEnumSpellingInApiLibConfig,\n 'one-enum-spelling-in-api-lib',\n async () =>\n (await import('./validate-one-enum-spelling-in-api-lib'))\n .OneEnumSpellingInApiLibValidator,\n OneEnumSpellingInApiLibConfig.SCHEMA,\n ),\n new CodePolicy(\n NoUtilityTypesInApiLibConfig,\n 'no-utility-types-in-api-lib',\n async () =>\n (await import('./validate-no-utility-types-in-api-lib'))\n .NoUtilityTypesInApiLibValidator,\n NoUtilityTypesInApiLibConfig.SCHEMA,\n ),\n new CodePolicy(\n RequiredTypeSuffixConfig,\n 'required-type-suffix',\n async () => (await import('./validate-required-type-suffix')).RequiredTypeSuffixValidator,\n RequiredTypeSuffixConfig.SCHEMA,\n ),\n new CodePolicy(\n FrameworkTsconfigConfig,\n 'framework-tsconfig',\n async () => (await import('./validate-framework-tsconfig')).FrameworkTsconfigValidator,\n FrameworkTsconfigConfig.SCHEMA,\n ),\n new CodePolicy(\n FrameworkPackagesConfig,\n 'framework-packages',\n async () => (await import('./validate-framework-packages')).FrameworkPackagesValidator,\n FrameworkPackagesConfig.SCHEMA,\n ),\n];\n"]}
@@ -0,0 +1,29 @@
1
+ import { SchemaShape, BaseRuleConfig } from '@webpieces/rules-sdk';
2
+ import { ModifiedCodeMode } from '@webpieces/rules-sdk';
3
+ /**
4
+ * `catch-must-propagate` (#1313) — a caught error must leave its catch WHOLE: rethrown, thrown as a
5
+ * cause, handed to a configured forwarder, returned, or stored on a member. Using only `err.message`,
6
+ * `String(err)` or a template, or dropping the error (`catch {}`, an unused binding), is refused.
7
+ *
8
+ * ONE rule, ONE syntax-only implementation (`CatchPropagationAnalyzer` in
9
+ * `@webpieces/tooling-common/catch-propagation`), run by BOTH runners: the Write/Edit guard and the build
10
+ * gate. This pack owns the config; `@webpieces/ai-hook-rules` contributes the guard half.
11
+ *
12
+ * Every field that decides behaviour is REQUIRED with no default (`.claude/rules/no-rule-defaults.md`):
13
+ * - `mode` — OFF | NEW_AND_MODIFIED_CODE (only a catch whose clause spans a changed line) |
14
+ * NEW_AND_MODIFIED_FILES (every catch in a changed file) | MODIFIED_PROJECTS / RUN_EVERY_TIME (every
15
+ * catch in each touched project / the whole repo — #1027).
16
+ * - `forwards` — the callee names a caught error may be handed to whole and count as propagated
17
+ * (`log.warn('x', err)` → `warn`; an entry with a dot, `logger.warn`, matches the call's tail). It may
18
+ * be empty — then only a throw, a return or a member store propagates — but it must be stated, because
19
+ * it decides which catches pass. The seed lists the usual logger levels plus `reject`.
20
+ *
21
+ * The framework-owned `excludePaths` exempts whole trees. The per-site escape hatch is
22
+ * `// webpieces-disable catch-must-propagate -- <reason of at least 20 characters>` on the catch's line or
23
+ * the line above it.
24
+ */
25
+ export declare class CatchMustPropagateConfig extends BaseRuleConfig {
26
+ mode?: ModifiedCodeMode;
27
+ forwards: string[];
28
+ static readonly SCHEMA: SchemaShape<CatchMustPropagateConfig>;
29
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CatchMustPropagateConfig = void 0;
4
+ const rules_sdk_1 = require("@webpieces/rules-sdk");
5
+ const rules_sdk_2 = require("@webpieces/rules-sdk");
6
+ /**
7
+ * `catch-must-propagate` (#1313) — a caught error must leave its catch WHOLE: rethrown, thrown as a
8
+ * cause, handed to a configured forwarder, returned, or stored on a member. Using only `err.message`,
9
+ * `String(err)` or a template, or dropping the error (`catch {}`, an unused binding), is refused.
10
+ *
11
+ * ONE rule, ONE syntax-only implementation (`CatchPropagationAnalyzer` in
12
+ * `@webpieces/tooling-common/catch-propagation`), run by BOTH runners: the Write/Edit guard and the build
13
+ * gate. This pack owns the config; `@webpieces/ai-hook-rules` contributes the guard half.
14
+ *
15
+ * Every field that decides behaviour is REQUIRED with no default (`.claude/rules/no-rule-defaults.md`):
16
+ * - `mode` — OFF | NEW_AND_MODIFIED_CODE (only a catch whose clause spans a changed line) |
17
+ * NEW_AND_MODIFIED_FILES (every catch in a changed file) | MODIFIED_PROJECTS / RUN_EVERY_TIME (every
18
+ * catch in each touched project / the whole repo — #1027).
19
+ * - `forwards` — the callee names a caught error may be handed to whole and count as propagated
20
+ * (`log.warn('x', err)` → `warn`; an entry with a dot, `logger.warn`, matches the call's tail). It may
21
+ * be empty — then only a throw, a return or a member store propagates — but it must be stated, because
22
+ * it decides which catches pass. The seed lists the usual logger levels plus `reject`.
23
+ *
24
+ * The framework-owned `excludePaths` exempts whole trees. The per-site escape hatch is
25
+ * `// webpieces-disable catch-must-propagate -- <reason of at least 20 characters>` on the catch's line or
26
+ * the line above it.
27
+ */
28
+ class CatchMustPropagateConfig extends rules_sdk_1.BaseRuleConfig {
29
+ forwards;
30
+ static SCHEMA = {
31
+ mode: new rules_sdk_1.FieldDef('string', rules_sdk_2.MODIFIED_CODE_MODES),
32
+ forwards: new rules_sdk_1.FieldDef('string[]'),
33
+ };
34
+ }
35
+ exports.CatchMustPropagateConfig = CatchMustPropagateConfig;
36
+ //# sourceMappingURL=catch-must-propagate-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catch-must-propagate-config.js","sourceRoot":"","sources":["../../../../../../packages/tooling/code-rules/src/configs/catch-must-propagate-config.ts"],"names":[],"mappings":";;;AAAA,oDAA6E;AAC7E,oDAA6E;AAE7E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,wBAAyB,SAAQ,0BAAc;IAExD,QAAQ,CAAY;IAEpB,MAAM,CAAU,MAAM,GAA0C;QAC5D,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,+BAAmB,CAAC;QACjD,QAAQ,EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;KACrC,CAAC;;AAPN,4DAQC","sourcesContent":["import { FieldDef, SchemaShape, BaseRuleConfig } from '@webpieces/rules-sdk';\nimport { ModifiedCodeMode, MODIFIED_CODE_MODES } from '@webpieces/rules-sdk';\n\n/**\n * `catch-must-propagate` (#1313) — a caught error must leave its catch WHOLE: rethrown, thrown as a\n * cause, handed to a configured forwarder, returned, or stored on a member. Using only `err.message`,\n * `String(err)` or a template, or dropping the error (`catch {}`, an unused binding), is refused.\n *\n * ONE rule, ONE syntax-only implementation (`CatchPropagationAnalyzer` in\n * `@webpieces/tooling-common/catch-propagation`), run by BOTH runners: the Write/Edit guard and the build\n * gate. This pack owns the config; `@webpieces/ai-hook-rules` contributes the guard half.\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 catch whose clause spans a changed line) |\n * NEW_AND_MODIFIED_FILES (every catch in a changed file) | MODIFIED_PROJECTS / RUN_EVERY_TIME (every\n * catch in each touched project / the whole repo — #1027).\n * - `forwards` — the callee names a caught error may be handed to whole and count as propagated\n * (`log.warn('x', err)` → `warn`; an entry with a dot, `logger.warn`, matches the call's tail). It may\n * be empty — then only a throw, a return or a member store propagates — but it must be stated, because\n * it decides which catches pass. The seed lists the usual logger levels plus `reject`.\n *\n * The framework-owned `excludePaths` exempts whole trees. The per-site escape hatch is\n * `// webpieces-disable catch-must-propagate -- <reason of at least 20 characters>` on the catch's line or\n * the line above it.\n */\nexport class CatchMustPropagateConfig extends BaseRuleConfig {\n declare mode?: ModifiedCodeMode;\n forwards!: string[];\n\n static readonly SCHEMA: SchemaShape<CatchMustPropagateConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n forwards: new FieldDef('string[]'),\n };\n}\n"]}
package/src/index.d.ts CHANGED
@@ -46,5 +46,7 @@ export { DEFAULT_TEMPLATE_DIRS, DEFAULT_BANNED_STATE_PATH_PREFIXES, NoStatePaths
46
46
  export { NoInlineImportInApiLibConfig, OneEnumSpellingInApiLibConfig } from './configs/api-lib-spelling-configs';
47
47
  export { NoUtilityTypesInApiLibConfig } from './configs/no-utility-types-config';
48
48
  export { RequiredTypeSuffixEntry, RequiredTypeSuffixConfig } from './configs/required-type-suffix-config';
49
+ export { CatchMustPropagateConfig } from './configs/catch-must-propagate-config';
50
+ export { CatchMustPropagateValidator, LocatedCatchFinding } from './validate-catch-must-propagate';
49
51
  export { PROJECT_SCAN_MODES, FrameworkTsconfigConfig, FrameworkPackagesEntry, FrameworkPackagesConfig } from './configs/tag-truth-configs';
50
52
  export type { ProjectScanMode } from './configs/tag-truth-configs';
package/src/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.frameworkTsconfigError = exports.TsconfigRuntimeViolation = exports.RuntimeCompilerOptions = exports.FrameworkTsconfigAudit = exports.FrameworkTsconfigValidator = exports.ScannedProject = exports.ProjectScanTargets = exports.ApiLibEnumIndex = exports.GoverningGlob = exports.SuffixRename = exports.SuffixEntryPicker = exports.ExportedTypeScanner = exports.RequiredTypeSuffixValidator = exports.UtilityTypeScanner = exports.NoUtilityTypesInApiLibValidator = exports.EnumSpellingScanner = exports.OneEnumSpellingInApiLibValidator = exports.InlineImportScanner = exports.NoInlineImportInApiLibValidator = exports.ApiLibSite = exports.ApiLibFile = exports.findDirectlyChangedProjectRoots = exports.auditSecurityContracts = exports.SecurityContractViolation = exports.EnsureWeAreSecureValidator = exports.RoleTagValidator = exports.FrameworkTagValidator = exports.findRedundantInjectInSource = exports.InjectAnnotationNotNeededForConcreteClassValidator = exports.NoFunctionOutsideClassValidator = exports.NoProcessExitOutsideMainValidator = exports.ProjectRoleResolver = exports.StatePathViolation = exports.StatePathHit = exports.NoStatePathsInTemplatesValidator = exports.NoClientCreationOutsideServerOrClientValidator = exports.NoSymbolDiTokensValidator = exports.NoDirectApiResolverValidator = exports.NoDestructureValidator = exports.NoUnmanagedExceptionsValidator = exports.CatchErrorPatternValidator = exports.NoInlineTypeLiteralsValidator = exports.RequireReturnTypeValidator = exports.MaxFileLinesValidator = exports.runNewMethods = exports.runModifiedMethods = exports.MaxMethodLinesValidator = exports.NoImplicitAnyValidator = exports.NoAnyUnknownValidator = exports.CodeValidator = void 0;
4
4
  exports.CLIENT_CREATION_SEVERITIES = exports.EnsureWeAreSecureConfig = exports.RoleTagConfig = exports.FrameworkTagConfig = exports.InjectAnnotationNotNeededForConcreteClassConfig = exports.NoFunctionOutsideClassConfig = exports.NoProcessExitOutsideMainConfig = exports.NoSymbolDiTokensConfig = exports.NoCustomCssConfig = exports.AngularNoDirectApiInResolverConfig = exports.CatchErrorPatternConfig = exports.NoUnmanagedExceptionsConfig = exports.NoDestructureConfig = exports.PrismaConverterConfig = exports.PrismaValidateDtosConfig = exports.NoImplicitAnyConfig = exports.NoAnyUnknownConfig = exports.NoInlineTypeLiteralsConfig = exports.RequireReturnTypeConfig = exports.MaxFileLinesConfig = exports.MaxMethodLinesConfig = exports.DIRECT_API_RESOLVER_MODES = exports.PRISMA_CONVERTER_MODES = exports.PRISMA_DTOS_MODES = exports.PROJECT_MODES = exports.INLINE_TYPE_MODES = exports.RETURN_TYPE_MODES = exports.METHOD_LIMIT_MODES = exports.ReactNativeCompatibility = exports.RuleExclusionsFactory = exports.GlobalExcludePaths = exports.ExclusionScopedPolicy = exports.RecordedSite = exports.ProjectEntry = exports.ProjectCatalog = exports.ScanRestriction = exports.GateScanScope = exports.ScanScope = exports.RunRequestParser = exports.RuleSelection = exports.CodeRulesRunRequest = exports.CodeRulesBootstrap = exports.validateCode = exports.PrismaConverterValidator = exports.PrismaValidateDtosValidator = exports.EnumText = exports.frameworkPackagesError = exports.FrameworkPackageViolation = exports.FrameworkPackagesAudit = exports.FrameworkPackagesValidator = void 0;
5
- exports.FrameworkPackagesConfig = exports.FrameworkPackagesEntry = exports.FrameworkTsconfigConfig = exports.PROJECT_SCAN_MODES = exports.RequiredTypeSuffixConfig = exports.RequiredTypeSuffixEntry = exports.NoUtilityTypesInApiLibConfig = exports.OneEnumSpellingInApiLibConfig = exports.NoInlineImportInApiLibConfig = exports.NoStatePathsInTemplatesConfig = exports.DEFAULT_BANNED_STATE_PATH_PREFIXES = exports.DEFAULT_TEMPLATE_DIRS = exports.NoClientCreationOutsideServerOrClientConfig = void 0;
5
+ exports.FrameworkPackagesConfig = exports.FrameworkPackagesEntry = exports.FrameworkTsconfigConfig = exports.PROJECT_SCAN_MODES = exports.LocatedCatchFinding = exports.CatchMustPropagateValidator = exports.CatchMustPropagateConfig = exports.RequiredTypeSuffixConfig = exports.RequiredTypeSuffixEntry = exports.NoUtilityTypesInApiLibConfig = exports.OneEnumSpellingInApiLibConfig = exports.NoInlineImportInApiLibConfig = exports.NoStatePathsInTemplatesConfig = exports.DEFAULT_BANNED_STATE_PATH_PREFIXES = exports.DEFAULT_TEMPLATE_DIRS = exports.NoClientCreationOutsideServerOrClientConfig = void 0;
6
6
  const tslib_1 = require("tslib");
7
7
  var code_validator_1 = require("./code-validator");
8
8
  Object.defineProperty(exports, "CodeValidator", { enumerable: true, get: function () { return code_validator_1.CodeValidator; } });
@@ -160,6 +160,11 @@ Object.defineProperty(exports, "NoUtilityTypesInApiLibConfig", { enumerable: tru
160
160
  var required_type_suffix_config_1 = require("./configs/required-type-suffix-config");
161
161
  Object.defineProperty(exports, "RequiredTypeSuffixEntry", { enumerable: true, get: function () { return required_type_suffix_config_1.RequiredTypeSuffixEntry; } });
162
162
  Object.defineProperty(exports, "RequiredTypeSuffixConfig", { enumerable: true, get: function () { return required_type_suffix_config_1.RequiredTypeSuffixConfig; } });
163
+ var catch_must_propagate_config_1 = require("./configs/catch-must-propagate-config");
164
+ Object.defineProperty(exports, "CatchMustPropagateConfig", { enumerable: true, get: function () { return catch_must_propagate_config_1.CatchMustPropagateConfig; } });
165
+ var validate_catch_must_propagate_1 = require("./validate-catch-must-propagate");
166
+ Object.defineProperty(exports, "CatchMustPropagateValidator", { enumerable: true, get: function () { return validate_catch_must_propagate_1.CatchMustPropagateValidator; } });
167
+ Object.defineProperty(exports, "LocatedCatchFinding", { enumerable: true, get: function () { return validate_catch_must_propagate_1.LocatedCatchFinding; } });
163
168
  var tag_truth_configs_1 = require("./configs/tag-truth-configs");
164
169
  Object.defineProperty(exports, "PROJECT_SCAN_MODES", { enumerable: true, get: function () { return tag_truth_configs_1.PROJECT_SCAN_MODES; } });
165
170
  Object.defineProperty(exports, "FrameworkTsconfigConfig", { enumerable: true, get: function () { return tag_truth_configs_1.FrameworkTsconfigConfig; } });
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/tooling/code-rules/src/index.ts"],"names":[],"mappings":";;;;;;AAAA,mDAAiE;AAAxD,+GAAA,aAAa,OAAA;AAEtB,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAC9B,uEAAoE;AAA3D,kIAAA,sBAAsB,OAAA;AAC/B,yEAA0F;AAAjF,oIAAA,uBAAuB,OAAA;AAAE,+HAAA,kBAAkB,OAAA;AACpD,+DAAuD;AAA9C,qHAAA,aAAa,OAAA;AACtB,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAC9B,iEAAqE;AAA5D,mIAAA,0BAA0B,OAAA;AACnC,uEAA2E;AAAlE,yIAAA,6BAA6B,OAAA;AACtC,+EAA4E;AAAnE,0IAAA,0BAA0B,OAAA;AACnC,uFAAoF;AAA3E,kJAAA,8BAA8B,OAAA;AACvC,qEAAmE;AAA1D,iIAAA,sBAAsB,OAAA;AAC/B,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,+EAA2E;AAAlE,yIAAA,yBAAyB,OAAA;AAClC,+HAAwH;AAA/G,sLAAA,8CAA8C,OAAA;AACvD,+FAIgD;AAH5C,wJAAA,gCAAgC,OAAA;AAChC,oIAAA,Y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A;AAAE,iHAAA,iBAAiB,OAAA;AAAE,sHAAA,sBAAsB,OAAA;AAAE,8HAAA,8BAA8B,OAAA;AAAE,4HAAA,4BAA4B,OAAA;AAAE,+IAAA,+CAA+C,OAAA;AAAE,kHAAA,kBAAkB,OAAA;AAAE,6GAAA,aAAa,OAAA;AAAE,uHAAA,uBAAuB,OAAA;AAEppB,iFAA8H;AAArH,uIAAA,0BAA0B,OAAA;AAAE,wJAAA,2CAA2C,OAAA;AAEhF,yEAA2I;AAAlI,8HAAA,qBAAqB,OAAA;AAAE,2IAAA,kCAAkC,OAAA;AAAE,sIAAA,6BAA6B,OAAA;AACjG,+EAAiH;AAAxG,wIAAA,4BAA4B,OAAA;AAAE,yIAAA,6BAA6B,OAAA;AACpE,6EAAiF;AAAxE,uIAAA,4BAA4B,OAAA;AACrC,qFAA0G;AAAjG,sIAAA,uBAAuB,OAAA;AAAE,uIAAA,wBAAwB,OAAA;AAC1D,iEAA2I;AAAlI,uHAAA,kBAAkB,OAAA;AAAE,4HAAA,uBAAuB,OAAA;AAAE,2HAAA,sBAAsB,OAAA;AAAE,4HAAA,uBAAuB,OAAA","sourcesContent":["export { CodeValidator, ExecutorResult } from './code-validator';\n\nexport { NoAnyUnknownValidator } from './validate-no-any-unknown';\nexport { NoImplicitAnyValidator } from './validate-no-implicit-any';\nexport { MaxMethodLinesValidator, runModifiedMethods } from './validate-modified-methods';\nexport { runNewMethods } from './validate-new-methods';\nexport { MaxFileLinesValidator } from './validate-modified-files';\nexport { RequireReturnTypeValidator } from './validate-return-types';\nexport { NoInlineTypeLiteralsValidator } from './validate-no-inline-types';\nexport { CatchErrorPatternValidator } from './validate-catch-error-pattern';\nexport { NoUnmanagedExceptionsValidator } from './validate-no-unmanaged-exceptions';\nexport { NoDestructureValidator } from './validate-no-destructure';\nexport { NoDirectApiResolverValidator } from './validate-no-direct-api-resolver';\nexport { NoSymbolDiTokensValidator } from './validate-no-symbol-di-tokens';\nexport { NoClientCreationOutsideServerOrClientValidator } from './validate-no-client-creation-outside-server-or-client';\nexport {\n NoStatePathsInTemplatesValidator,\n StatePathHit,\n StatePathViolation,\n} from './validate-no-state-paths-in-templates';\nexport { ProjectRoleResolver } from './project-role-resolver';\nexport { NoProcessExitOutsideMainValidator } from './validate-no-process-exit-outside-main';\nexport { NoFunctionOutsideClassValidator } from './validate-no-function-outside-class';\nexport {\n InjectAnnotationNotNeededForConcreteClassValidator,\n findRedundantInjectInSource,\n} from './validate-inject-annotation-not-needed-for-concrete-class';\nexport { FrameworkTagValidator } from './validate-framework-tag';\nexport { RoleTagValidator } from './validate-role-tag';\nexport {\n EnsureWeAreSecureValidator,\n SecurityContractViolation,\n auditSecurityContracts,\n findDirectlyChangedProjectRoots,\n} from './validate-ensure-we-are-secure';\nexport { ApiLibFile, ApiLibSite } from './api-lib-source-rule';\nexport { NoInlineImportInApiLibValidator, InlineImportScanner } from './validate-no-inline-import-in-api-lib';\nexport { OneEnumSpellingInApiLibValidator, EnumSpellingScanner } from './validate-one-enum-spelling-in-api-lib';\nexport { NoUtilityTypesInApiLibValidator, UtilityTypeScanner } from './validate-no-utility-types-in-api-lib';\nexport {\n RequiredTypeSuffixValidator,\n ExportedTypeScanner,\n SuffixEntryPicker,\n SuffixRename,\n GoverningGlob,\n} from './validate-required-type-suffix';\nexport { ApiLibEnumIndex } from './api-lib-enum-index';\nexport { ProjectScanTargets, ScannedProject } from './project-scan-targets';\nexport {\n FrameworkTsconfigValidator,\n FrameworkTsconfigAudit,\n RuntimeCompilerOptions,\n TsconfigRuntimeViolation,\n frameworkTsconfigError,\n} from './validate-framework-tsconfig';\nexport {\n FrameworkPackagesValidator,\n FrameworkPackagesAudit,\n FrameworkPackageViolation,\n frameworkPackagesError,\n} from './validate-framework-packages';\nexport { EnumText } from './api-lib-enum-text';\nexport { PrismaValidateDtosValidator } from './validate-dtos';\nexport { PrismaConverterValidator } from './validate-prisma-converters';\nexport { default as validateCode } from './validate-code';\nexport { CodeRulesBootstrap } from './code-rules-bootstrap';\nexport { CodeRulesRunRequest, RuleSelection, RunRequestParser } from './code-rules-run-request';\nexport { ScanScope, GateScanScope, ScanRestriction, ProjectCatalog, ProjectEntry, RecordedSite } from './scan-scope';\n// Where code-rules applies the framework-owned path exclusions to every rule it composes (#1253).\nexport { ExclusionScopedPolicy, GlobalExcludePaths, RuleExclusionsFactory } from './rule-dispatch';\n\nexport { ReactNativeCompatibility } from './react-native-compatibility';\n\nexport { METHOD_LIMIT_MODES, RETURN_TYPE_MODES, INLINE_TYPE_MODES, PROJECT_MODES, PRISMA_DTOS_MODES, PRISMA_CONVERTER_MODES, DIRECT_API_RESOLVER_MODES, MaxMethodLinesConfig, MaxFileLinesConfig, RequireReturnTypeConfig, NoInlineTypeLiteralsConfig, NoAnyUnknownConfig, NoImplicitAnyConfig, PrismaValidateDtosConfig, PrismaConverterConfig, NoDestructureConfig, NoUnmanagedExceptionsConfig, CatchErrorPatternConfig, AngularNoDirectApiInResolverConfig, NoCustomCssConfig, NoSymbolDiTokensConfig, NoProcessExitOutsideMainConfig, NoFunctionOutsideClassConfig, InjectAnnotationNotNeededForConcreteClassConfig, FrameworkTagConfig, RoleTagConfig, EnsureWeAreSecureConfig } from './configs/rule-configs';\nexport type { MethodLimitMode, ReturnTypeMode, InlineTypeMode, ProjectMode, PrismaValidateDtosMode, PrismaConverterMode, DirectApiResolverMode } from './configs/rule-configs';\nexport { CLIENT_CREATION_SEVERITIES, NoClientCreationOutsideServerOrClientConfig } from './configs/no-client-creation-config';\nexport type { ClientCreationSeverity } from './configs/no-client-creation-config';\nexport { DEFAULT_TEMPLATE_DIRS, DEFAULT_BANNED_STATE_PATH_PREFIXES, NoStatePathsInTemplatesConfig } from './configs/no-state-paths-config';\nexport { NoInlineImportInApiLibConfig, OneEnumSpellingInApiLibConfig } from './configs/api-lib-spelling-configs';\nexport { NoUtilityTypesInApiLibConfig } from './configs/no-utility-types-config';\nexport { RequiredTypeSuffixEntry, RequiredTypeSuffixConfig } from './configs/required-type-suffix-config';\nexport { PROJECT_SCAN_MODES, FrameworkTsconfigConfig, FrameworkPackagesEntry, FrameworkPackagesConfig } from './configs/tag-truth-configs';\nexport type { ProjectScanMode } from './configs/tag-truth-configs';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/tooling/code-rules/src/index.ts"],"names":[],"mappings":";;;;;;AAAA,mDAAiE;AAAxD,+GAAA,aAAa,OAAA;AAEtB,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAC9B,uEAAoE;AAA3D,kIAAA,sBAAsB,OAAA;AAC/B,yEAA0F;AAAjF,oIAAA,uBAAuB,OAAA;AAAE,+HAAA,kBAAkB,OAAA;AACpD,+DAAuD;AAA9C,qHAAA,aAAa,OAAA;AACtB,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAC9B,iEAAqE;AAA5D,mIAAA,0BAA0B,OAAA;AACnC,uEAA2E;AAAlE,yIAAA,6BAA6B,OAAA;AACtC,+EAA4E;AAAnE,0IAAA,0BAA0B,OAAA;AACnC,uFAAoF;AAA3E,kJAAA,8BAA8B,OAAA;AACvC,qEAAmE;AAA1D,iIAAA,sBAAsB,OAAA;AAC/B,qFAAiF;AAAxE,+IAAA,4BAA4B,OAAA;AACrC,+EAA2E;AAAlE,yIAAA,yBAAyB,OAAA;AAClC,+HAAwH;AAA/G,sLAAA,8CAA8C,OAAA;AACvD,+FAIgD;AAH5C,wJAAA,gCAAgC,OAAA;AAChC,oIAAA,YAAY,OAAA;AACZ,0IAAA,kBAAkB,OAAA;AAEtB,iEAA8D;AAArD,4HAAA,mBAAmB,OAAA;AAC5B,iGAA4F;AAAnF,0JAAA,iCAAiC,OAAA;AAC1C,2FAAuF;AAA9E,qJAAA,+BAA+B,OAAA;AACxC,uIAGoE;AAFhE,8LAAA,kDAAkD,OAAA;AAClD,uKAAA,2BAA2B,OAAA;AAE/B,mEAAiE;AAAxD,+HAAA,qBAAqB,OAAA;AAC9B,yDAAuD;AAA9C,qHAAA,gBA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A,qBAAqB,OAAA;AAAE,2IAAA,kCAAkC,OAAA;AAAE,sIAAA,6BAA6B,OAAA;AACjG,+EAAiH;AAAxG,wIAAA,4BAA4B,OAAA;AAAE,yIAAA,6BAA6B,OAAA;AACpE,6EAAiF;AAAxE,uIAAA,4BAA4B,OAAA;AACrC,qFAA0G;AAAjG,sIAAA,uBAAuB,OAAA;AAAE,uIAAA,wBAAwB,OAAA;AAC1D,qFAAiF;AAAxE,uIAAA,wBAAwB,OAAA;AACjC,iFAAmG;AAA1F,4IAAA,2BAA2B,OAAA;AAAE,oIAAA,mBAAmB,OAAA;AACzD,iEAA2I;AAAlI,uHAAA,kBAAkB,OAAA;AAAE,4HAAA,uBAAuB,OAAA;AAAE,2HAAA,sBAAsB,OAAA;AAAE,4HAAA,uBAAuB,OAAA","sourcesContent":["export { CodeValidator, ExecutorResult } from './code-validator';\n\nexport { NoAnyUnknownValidator } from './validate-no-any-unknown';\nexport { NoImplicitAnyValidator } from './validate-no-implicit-any';\nexport { MaxMethodLinesValidator, runModifiedMethods } from './validate-modified-methods';\nexport { runNewMethods } from './validate-new-methods';\nexport { MaxFileLinesValidator } from './validate-modified-files';\nexport { RequireReturnTypeValidator } from './validate-return-types';\nexport { NoInlineTypeLiteralsValidator } from './validate-no-inline-types';\nexport { CatchErrorPatternValidator } from './validate-catch-error-pattern';\nexport { NoUnmanagedExceptionsValidator } from './validate-no-unmanaged-exceptions';\nexport { NoDestructureValidator } from './validate-no-destructure';\nexport { NoDirectApiResolverValidator } from './validate-no-direct-api-resolver';\nexport { NoSymbolDiTokensValidator } from './validate-no-symbol-di-tokens';\nexport { NoClientCreationOutsideServerOrClientValidator } from './validate-no-client-creation-outside-server-or-client';\nexport {\n NoStatePathsInTemplatesValidator,\n StatePathHit,\n StatePathViolation,\n} from './validate-no-state-paths-in-templates';\nexport { ProjectRoleResolver } from './project-role-resolver';\nexport { NoProcessExitOutsideMainValidator } from './validate-no-process-exit-outside-main';\nexport { NoFunctionOutsideClassValidator } from './validate-no-function-outside-class';\nexport {\n InjectAnnotationNotNeededForConcreteClassValidator,\n findRedundantInjectInSource,\n} from './validate-inject-annotation-not-needed-for-concrete-class';\nexport { FrameworkTagValidator } from './validate-framework-tag';\nexport { RoleTagValidator } from './validate-role-tag';\nexport {\n EnsureWeAreSecureValidator,\n SecurityContractViolation,\n auditSecurityContracts,\n findDirectlyChangedProjectRoots,\n} from './validate-ensure-we-are-secure';\nexport { ApiLibFile, ApiLibSite } from './api-lib-source-rule';\nexport { NoInlineImportInApiLibValidator, InlineImportScanner } from './validate-no-inline-import-in-api-lib';\nexport { OneEnumSpellingInApiLibValidator, EnumSpellingScanner } from './validate-one-enum-spelling-in-api-lib';\nexport { NoUtilityTypesInApiLibValidator, UtilityTypeScanner } from './validate-no-utility-types-in-api-lib';\nexport {\n RequiredTypeSuffixValidator,\n ExportedTypeScanner,\n SuffixEntryPicker,\n SuffixRename,\n GoverningGlob,\n} from './validate-required-type-suffix';\nexport { ApiLibEnumIndex } from './api-lib-enum-index';\nexport { ProjectScanTargets, ScannedProject } from './project-scan-targets';\nexport {\n FrameworkTsconfigValidator,\n FrameworkTsconfigAudit,\n RuntimeCompilerOptions,\n TsconfigRuntimeViolation,\n frameworkTsconfigError,\n} from './validate-framework-tsconfig';\nexport {\n FrameworkPackagesValidator,\n FrameworkPackagesAudit,\n FrameworkPackageViolation,\n frameworkPackagesError,\n} from './validate-framework-packages';\nexport { EnumText } from './api-lib-enum-text';\nexport { PrismaValidateDtosValidator } from './validate-dtos';\nexport { PrismaConverterValidator } from './validate-prisma-converters';\nexport { default as validateCode } from './validate-code';\nexport { CodeRulesBootstrap } from './code-rules-bootstrap';\nexport { CodeRulesRunRequest, RuleSelection, RunRequestParser } from './code-rules-run-request';\nexport { ScanScope, GateScanScope, ScanRestriction, ProjectCatalog, ProjectEntry, RecordedSite } from './scan-scope';\n// Where code-rules applies the framework-owned path exclusions to every rule it composes (#1253).\nexport { ExclusionScopedPolicy, GlobalExcludePaths, RuleExclusionsFactory } from './rule-dispatch';\n\nexport { ReactNativeCompatibility } from './react-native-compatibility';\n\nexport { METHOD_LIMIT_MODES, RETURN_TYPE_MODES, INLINE_TYPE_MODES, PROJECT_MODES, PRISMA_DTOS_MODES, PRISMA_CONVERTER_MODES, DIRECT_API_RESOLVER_MODES, MaxMethodLinesConfig, MaxFileLinesConfig, RequireReturnTypeConfig, NoInlineTypeLiteralsConfig, NoAnyUnknownConfig, NoImplicitAnyConfig, PrismaValidateDtosConfig, PrismaConverterConfig, NoDestructureConfig, NoUnmanagedExceptionsConfig, CatchErrorPatternConfig, AngularNoDirectApiInResolverConfig, NoCustomCssConfig, NoSymbolDiTokensConfig, NoProcessExitOutsideMainConfig, NoFunctionOutsideClassConfig, InjectAnnotationNotNeededForConcreteClassConfig, FrameworkTagConfig, RoleTagConfig, EnsureWeAreSecureConfig } from './configs/rule-configs';\nexport type { MethodLimitMode, ReturnTypeMode, InlineTypeMode, ProjectMode, PrismaValidateDtosMode, PrismaConverterMode, DirectApiResolverMode } from './configs/rule-configs';\nexport { CLIENT_CREATION_SEVERITIES, NoClientCreationOutsideServerOrClientConfig } from './configs/no-client-creation-config';\nexport type { ClientCreationSeverity } from './configs/no-client-creation-config';\nexport { DEFAULT_TEMPLATE_DIRS, DEFAULT_BANNED_STATE_PATH_PREFIXES, NoStatePathsInTemplatesConfig } from './configs/no-state-paths-config';\nexport { NoInlineImportInApiLibConfig, OneEnumSpellingInApiLibConfig } from './configs/api-lib-spelling-configs';\nexport { NoUtilityTypesInApiLibConfig } from './configs/no-utility-types-config';\nexport { RequiredTypeSuffixEntry, RequiredTypeSuffixConfig } from './configs/required-type-suffix-config';\nexport { CatchMustPropagateConfig } from './configs/catch-must-propagate-config';\nexport { CatchMustPropagateValidator, LocatedCatchFinding } from './validate-catch-must-propagate';\nexport { PROJECT_SCAN_MODES, FrameworkTsconfigConfig, FrameworkPackagesEntry, FrameworkPackagesConfig } from './configs/tag-truth-configs';\nexport type { ProjectScanMode } from './configs/tag-truth-configs';\n"]}
package/src/rule-help.js CHANGED
@@ -16,6 +16,7 @@ exports.ruleHelp = {
16
16
  'catch-error-pattern': new rules_sdk_1.RuleHelp('Narrow caught errors through the shared error conversion pattern.', 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.'),
17
17
  'no-unmanaged-exceptions': new rules_sdk_1.RuleHelp('Handle or explicitly document exceptions at the responsible boundary.', 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.'),
18
18
  'angular-no-direct-api-in-resolver': new rules_sdk_1.RuleHelp('Keep direct API client construction out of Angular resolvers.', 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.'),
19
+ 'catch-must-propagate': new rules_sdk_1.RuleHelp('Require a caught error to propagate whole: rethrown, thrown as a cause, forwarded, returned or stored.', 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.'),
19
20
  'no-symbol-di-tokens': new rules_sdk_1.RuleHelp('Use class tokens for dependency injection instead of symbol tokens.', 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.'),
20
21
  'no-client-creation-outside-server-or-client': new rules_sdk_1.RuleHelp('Construct API clients only in their designated server or client layer.', 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.'),
21
22
  'no-custom-css': new rules_sdk_1.RuleHelp('Use the configured styling system instead of custom CSS in governed files.', 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.'),
@@ -1 +1 @@
1
- {"version":3,"file":"rule-help.js","sourceRoot":"","sources":["../../../../../packages/tooling/code-rules/src/rule-help.ts"],"names":[],"mappings":";;;AAAA,oDAAgD;AAEhD,gEAAgE;AACnD,QAAA,QAAQ,GAAuC;IACxD,kBAAkB,EAAE,IAAI,oBAAQ,CAC5B,mDAAmD,EACnD,sIAAsI,CACzI;IACD,gBAAgB,EAAE,IAAI,oBAAQ,CAC1B,w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AAQ,CACzB,sEAAsE,EACtE,sIAAsI,CACzI;IACD,UAAU,EAAE,IAAI,oBAAQ,CACpB,kFAAkF,EAClF,sIAAsI,CACzI;IACD,sBAAsB,EAAE,IAAI,oBAAQ,CAChC,8IAA8I,EAC9I,sIAAsI,CACzI;IACD,6BAA6B,EAAE,IAAI,oBAAQ,CACvC,mDAAmD,EACnD,sIAAsI,CACzI;IACD,8BAA8B,EAAE,IAAI,oBAAQ,CACxC,qDAAqD,EACrD,sIAAsI,CACzI;IACD,6BAA6B,EAAE,IAAI,oBAAQ,CACvC,iEAAiE,EACjE,sIAAsI,CACzI;IACD,sBAAsB,EAAE,IAAI,oBAAQ,CAChC,oDAAoD,EACpD,sIAAsI,CACzI;IACD,oBAAoB,EAAE,IAAI,oBAAQ,CAC9B,yEAAyE,EACzE,sIAAsI,CACzI;IACD,oBAAoB,EAAE,IAAI,oBAAQ,CAC9B,oEAAoE,EACpE,sIAAsI,CACzI;CACJ,CAAC","sourcesContent":["import { RuleHelp } from '@webpieces/rules-sdk';\n\n/** Owner-authored guidance consumed by the registry catalog. */\nexport const ruleHelp: Readonly<Record<string, RuleHelp>> = {\n 'max-method-lines': new RuleHelp(\n 'Limit method length in the configured scan scope.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'max-file-lines': new RuleHelp(\n 'Limit source file length in the configured scan scope.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'require-return-type': new RuleHelp(\n 'Require explicit function and method return types.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-inline-type-literals': new RuleHelp(\n 'Use named data classes instead of inline object type declarations.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-any-unknown': new RuleHelp(\n 'Require concrete types outside explicitly permitted opaque boundaries.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-implicit-any': new RuleHelp(\n 'Require explicit parameter types when inference does not establish them.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'prisma-validate-dtos': new RuleHelp(\n 'Validate Prisma-facing DTO declarations against the generated model.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'prisma-converter': new RuleHelp(\n 'Validate the converters between Prisma models and application DTOs.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-destructure': new RuleHelp(\n 'Use whole values or explicit property access instead of destructuring.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'catch-error-pattern': new RuleHelp(\n 'Narrow caught errors through the shared error conversion pattern.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-unmanaged-exceptions': new RuleHelp(\n 'Handle or explicitly document exceptions at the responsible boundary.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'angular-no-direct-api-in-resolver': new RuleHelp(\n 'Keep direct API client construction out of Angular resolvers.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-symbol-di-tokens': new RuleHelp(\n 'Use class tokens for dependency injection instead of symbol tokens.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-client-creation-outside-server-or-client': new RuleHelp(\n 'Construct API clients only in their designated server or client layer.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-custom-css': new RuleHelp(\n 'Use the configured styling system instead of custom CSS in governed files.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-state-paths-in-templates': new RuleHelp(\n 'Use the declared state binding pattern in application templates.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-process-exit-outside-main': new RuleHelp(\n 'Restrict process termination to executable application boundaries.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-function-outside-class': new RuleHelp(\n 'Put business operations in instance methods on classes.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'inject-annotation-not-needed-for-concrete-class': new RuleHelp(\n 'Inject concrete classes by their class token without redundant annotations.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'framework-tag': new RuleHelp(\n 'Match project framework tags to their actual code and package usage.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'role-tag': new RuleHelp(\n 'Match project role tags to their actual API and implementation responsibilities.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'ensure-we-are-secure': new RuleHelp(\n 'Audit canonical WpAuth credential alternatives and WpAuthorization operation policies on every HTTP endpoint; audit explicit IPC boundaries.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-inline-import-in-api-lib': new RuleHelp(\n 'Keep API library type imports explicit and named.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'one-enum-spelling-in-api-lib': new RuleHelp(\n 'Use one enum declaration spelling in API libraries.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-utility-types-in-api-lib': new RuleHelp(\n 'Use explicit named API data contracts instead of utility types.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'required-type-suffix': new RuleHelp(\n 'Require configured suffixes on API contract types.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'framework-tsconfig': new RuleHelp(\n 'Align framework-specific TypeScript settings with project declarations.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'framework-packages': new RuleHelp(\n 'Align framework packages with the configured project requirements.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n};\n"]}
1
+ {"version":3,"file":"rule-help.js","sourceRoot":"","sources":["../../../../../packages/tooling/code-rules/src/rule-help.ts"],"names":[],"mappings":";;;AAAA,oDAAgD;AAEhD,gEAAgE;AACnD,QAAA,QAAQ,GAAuC;IACxD,kBAAkB,EAAE,IAAI,oBAAQ,CAC5B,mDAAmD,EACnD,sIAAsI,CACzI;IACD,gBAAgB,EAAE,IAAI,oBAAQ,CAC1B,wDAAwD,EACxD,sIAAsI,CACzI;IACD,qBAAqB,EAAE,IAAI,oBAAQ,CAC/B,oDAAoD,EACpD,sIAAsI,CACzI;IACD,yBAAyB,EAAE,IAAI,oBAAQ,CACnC,oEAAoE,EACpE,sIAAsI,CACzI;IACD,gBAAgB,EAAE,IAAI,oBAAQ,CAC1B,wEAAwE,EACxE,sIAAsI,CACzI;IACD,iBAAiB,EAAE,IAAI,oBAAQ,CAC3B,0EAA0E,EAC1E,sIAAsI,CACzI;IACD,sBAAsB,EAAE,IAAI,oBAAQ,CAChC,sEAAsE,EACtE,sIAAsI,CACzI;IACD,kBAAkB,EAAE,IAAI,oBAAQ,CAC5B,qEAAqE,EACrE,sIAAsI,CACzI;IACD,gBAAgB,EAAE,IAAI,oBAAQ,CAC1B,wEAAwE,EACxE,sIAAsI,CACzI;IACD,qBAAqB,EAAE,IAAI,oBAAQ,CAC/B,mEAAmE,EACnE,sIAAsI,CACzI;IACD,yBAAyB,EAAE,IAAI,oBAAQ,CACnC,uEAAuE,EACvE,sIAAsI,CACzI;IACD,mCAAmC,EA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C","sourcesContent":["import { RuleHelp } from '@webpieces/rules-sdk';\n\n/** Owner-authored guidance consumed by the registry catalog. */\nexport const ruleHelp: Readonly<Record<string, RuleHelp>> = {\n 'max-method-lines': new RuleHelp(\n 'Limit method length in the configured scan scope.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'max-file-lines': new RuleHelp(\n 'Limit source file length in the configured scan scope.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'require-return-type': new RuleHelp(\n 'Require explicit function and method return types.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-inline-type-literals': new RuleHelp(\n 'Use named data classes instead of inline object type declarations.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-any-unknown': new RuleHelp(\n 'Require concrete types outside explicitly permitted opaque boundaries.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-implicit-any': new RuleHelp(\n 'Require explicit parameter types when inference does not establish them.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'prisma-validate-dtos': new RuleHelp(\n 'Validate Prisma-facing DTO declarations against the generated model.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'prisma-converter': new RuleHelp(\n 'Validate the converters between Prisma models and application DTOs.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-destructure': new RuleHelp(\n 'Use whole values or explicit property access instead of destructuring.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'catch-error-pattern': new RuleHelp(\n 'Narrow caught errors through the shared error conversion pattern.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-unmanaged-exceptions': new RuleHelp(\n 'Handle or explicitly document exceptions at the responsible boundary.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'angular-no-direct-api-in-resolver': new RuleHelp(\n 'Keep direct API client construction out of Angular resolvers.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'catch-must-propagate': new RuleHelp(\n 'Require a caught error to propagate whole: rethrown, thrown as a cause, forwarded, returned or stored.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-symbol-di-tokens': new RuleHelp(\n 'Use class tokens for dependency injection instead of symbol tokens.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-client-creation-outside-server-or-client': new RuleHelp(\n 'Construct API clients only in their designated server or client layer.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-custom-css': new RuleHelp(\n 'Use the configured styling system instead of custom CSS in governed files.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-state-paths-in-templates': new RuleHelp(\n 'Use the declared state binding pattern in application templates.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-process-exit-outside-main': new RuleHelp(\n 'Restrict process termination to executable application boundaries.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-function-outside-class': new RuleHelp(\n 'Put business operations in instance methods on classes.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'inject-annotation-not-needed-for-concrete-class': new RuleHelp(\n 'Inject concrete classes by their class token without redundant annotations.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'framework-tag': new RuleHelp(\n 'Match project framework tags to their actual code and package usage.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'role-tag': new RuleHelp(\n 'Match project role tags to their actual API and implementation responsibilities.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'ensure-we-are-secure': new RuleHelp(\n 'Audit canonical WpAuth credential alternatives and WpAuthorization operation policies on every HTTP endpoint; audit explicit IPC boundaries.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-inline-import-in-api-lib': new RuleHelp(\n 'Keep API library type imports explicit and named.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'one-enum-spelling-in-api-lib': new RuleHelp(\n 'Use one enum declaration spelling in API libraries.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'no-utility-types-in-api-lib': new RuleHelp(\n 'Use explicit named API data contracts instead of utility types.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'required-type-suffix': new RuleHelp(\n 'Require configured suffixes on API contract types.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'framework-tsconfig': new RuleHelp(\n 'Align framework-specific TypeScript settings with project declarations.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n 'framework-packages': new RuleHelp(\n 'Align framework packages with the configured project requirements.',\n 'Apply this policy in source, or review its explicit settings in {configFile}. An intentional opt-out requires complete OFF settings.',\n ),\n};\n"]}
@@ -20,6 +20,7 @@ exports.optionalTuning = {
20
20
  },
21
21
  "catch-error-pattern": {},
22
22
  "no-unmanaged-exceptions": {},
23
+ "catch-must-propagate": {},
23
24
  "angular-no-direct-api-in-resolver": {},
24
25
  "no-symbol-di-tokens": {},
25
26
  "no-client-creation-outside-server-or-client": {},
@@ -117,6 +118,22 @@ exports.recommendedSeeds = {
117
118
  "turnOffRuleUntilEpoch": 0,
118
119
  "turnOffRuleWhileOnBranch": null
119
120
  },
121
+ "catch-must-propagate": {
122
+ "mode": "NEW_AND_MODIFIED_CODE",
123
+ "turnOffRuleUntilEpoch": 0,
124
+ "turnOffRuleWhileOnBranch": null,
125
+ "forwards": [
126
+ "error",
127
+ "warn",
128
+ "info",
129
+ "debug",
130
+ "trace",
131
+ "reject",
132
+ "handleError",
133
+ "reportError",
134
+ "captureException"
135
+ ]
136
+ },
120
137
  "angular-no-direct-api-in-resolver": {
121
138
  "mode": "NEW_AND_MODIFIED_CODE",
122
139
  "turnOffRuleUntilEpoch": 0,
@@ -1 +1 @@
1
- {"version":3,"file":"rule-settings.js","sourceRoot":"","sources":["../../../../../packages/tooling/code-rules/src/rule-settings.ts"],"names":[],"mappings":";;;AAEA,oFAAoF;AACvE,QAAA,cAAc,GAA2C;IAClE,kBAAkB,EAAE;QAChB,OAAO,EAAE,EAAE;KACd;IACD,gBAAgB,EAAE;QACd,OAAO,EAAE,GAAG;KACf;IACD,qBAAqB,EAAE,EAAE;IACzB,yBAAyB,EAAE,EAAE;IAC7B,gBAAgB,EAAE,EAAE;IACpB,iBAAiB,EAAE,EAAE;IACrB,sBAAsB,EAAE,EAAE;IAC1B,kBAAkB,EAAE,EAAE;IACtB,gBAAgB,EAAE;QACd,eAAe,EAAE,IAAI;KACxB;IACD,qBAAqB,EAAE,EAAE;IACzB,yBAAyB,EAAE,EAAE;IAC7B,mCAAmC,EAAE,EAAE;IACvC,qBAAqB,EAAE,EAAE;IACzB,6CAA6C,EAAE,EAAE;IACjD,eAAe,EAAE;QACb,YAAY,EAAE,EAAE;KACnB;IACD,6BAA6B,EAAE,EAAE;IACjC,8BAA8B,EAAE,EAAE;IAClC,2BAA2B,EAAE,EAAE;IAC/B,iDAAiD,EAAE,EAAE;IACrD,eAAe,EAAE;QACb,Y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AAU,EAAE;oBACR,YAAY;iBACf;gBACD,YAAY,EAAE;oBACV,SAAS;iBACZ;aACJ;YACD;gBACI,UAAU,EAAE;oBACR,OAAO;oBACP,cAAc;oBACd,OAAO;oBACP,SAAS;oBACT,sBAAsB;iBACzB;gBACD,YAAY,EAAE;oBACV,OAAO;oBACP,cAAc;iBACjB;aACJ;YACD;gBACI,UAAU,EAAE;oBACR,SAAS;oBACT,gBAAgB;oBAChB,YAAY;oBACZ,qBAAqB;oBACrB,iBAAiB;iBACpB;gBACD,YAAY,EAAE;oBACV,MAAM;oBACN,SAAS;iBACZ;aACJ;YACD;gBACI,UAAU,EAAE;oBACR,UAAU;iBACb;gBACD,YAAY,EAAE;oBACV,SAAS;oBACT,SAAS;oBACT,OAAO;iBACV;aACJ;SACJ;KACJ;CACJ,CAAC","sourcesContent":["import { ConfigObject } from '@webpieces/rules-sdk';\n\n/** Optional knobs only. Required behaviour is always supplied by the repository. */\nexport const optionalTuning: Readonly<Record<string, ConfigObject>> = {\n \"max-method-lines\": {\n \"limit\": 80\n },\n \"max-file-lines\": {\n \"limit\": 900\n },\n \"require-return-type\": {},\n \"no-inline-type-literals\": {},\n \"no-any-unknown\": {},\n \"no-implicit-any\": {},\n \"prisma-validate-dtos\": {},\n \"prisma-converter\": {},\n \"no-destructure\": {\n \"allowTopLevel\": true\n },\n \"catch-error-pattern\": {},\n \"no-unmanaged-exceptions\": {},\n \"angular-no-direct-api-in-resolver\": {},\n \"no-symbol-di-tokens\": {},\n \"no-client-creation-outside-server-or-client\": {},\n \"no-custom-css\": {\n \"allowGlobs\": []\n },\n \"no-state-paths-in-templates\": {},\n \"no-process-exit-outside-main\": {},\n \"no-function-outside-class\": {},\n \"inject-annotation-not-needed-for-concrete-class\": {},\n \"framework-tag\": {\n \"knownTypes\": [\n \"browser\",\n \"react\",\n \"angular\",\n \"node\",\n \"express\",\n \"react-native\"\n ]\n },\n \"role-tag\": {\n \"knownTypes\": [\n \"server\",\n \"app\",\n \"bundle\",\n \"designed-lib\",\n \"lib\",\n \"client\",\n \"api-lib\",\n \"api-client\"\n ]\n },\n \"ensure-we-are-secure\": {},\n \"no-inline-import-in-api-lib\": {},\n \"one-enum-spelling-in-api-lib\": {},\n \"no-utility-types-in-api-lib\": {},\n \"required-type-suffix\": {},\n \"framework-tsconfig\": {},\n \"framework-packages\": {}\n};\n\n/** Written for review by setup/sync; never used as a loader fallback. */\nexport const recommendedSeeds: Readonly<Record<string, ConfigObject>> = {\n \"max-method-lines\": {\n \"mode\": \"NEW_AND_MODIFIED_METHODS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"max-file-lines\": {\n \"mode\": \"NEW_AND_MODIFIED_FILES\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"require-return-type\": {\n \"mode\": \"NEW_AND_MODIFIED_METHODS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-inline-type-literals\": {\n \"mode\": \"NEW_AND_MODIFIED_METHODS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-any-unknown\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-implicit-any\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"prisma-validate-dtos\": {\n \"mode\": \"MODIFIED_CLASS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"prisma-converter\": {\n \"mode\": \"NEW_AND_MODIFIED_METHODS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-destructure\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"catch-error-pattern\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-unmanaged-exceptions\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"angular-no-direct-api-in-resolver\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-symbol-di-tokens\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-client-creation-outside-server-or-client\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-custom-css\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-state-paths-in-templates\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-process-exit-outside-main\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-function-outside-class\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"inject-annotation-not-needed-for-concrete-class\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"framework-tag\": {\n \"mode\": \"MODIFIED_PROJECTS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"role-tag\": {\n \"mode\": \"MODIFIED_PROJECTS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"ensure-we-are-secure\": {\n \"mode\": \"MODIFIED_PROJECTS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-inline-import-in-api-lib\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"one-enum-spelling-in-api-lib\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-utility-types-in-api-lib\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null,\n \"paths\": [\n \"libraries/apis/**\"\n ]\n },\n \"required-type-suffix\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null,\n \"entries\": [\n {\n \"paths\": [\n \"libraries/apis/**\"\n ],\n \"suffixes\": [\n \"Request\",\n \"Response\",\n \"Event\",\n \"Dto\",\n \"Api\"\n ],\n \"exempt\": false\n }\n ]\n },\n \"framework-tsconfig\": {\n \"mode\": \"MODIFIED_PROJECTS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"framework-packages\": {\n \"mode\": \"MODIFIED_PROJECTS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null,\n \"entries\": [\n {\n \"packages\": [\n \"@angular/*\"\n ],\n \"frameworks\": [\n \"angular\"\n ]\n },\n {\n \"packages\": [\n \"react\",\n \"react-native\",\n \"expo*\",\n \"@expo/*\",\n \"@sentry/react-native\"\n ],\n \"frameworks\": [\n \"react\",\n \"react-native\"\n ]\n },\n {\n \"packages\": [\n \"express\",\n \"firebase-admin\",\n \"googleapis\",\n \"google-auth-library\",\n \"@google-cloud/*\"\n ],\n \"frameworks\": [\n \"node\",\n \"express\"\n ]\n },\n {\n \"packages\": [\n \"firebase\"\n ],\n \"frameworks\": [\n \"browser\",\n \"angular\",\n \"react\"\n ]\n }\n ]\n }\n};\n"]}
1
+ {"version":3,"file":"rule-settings.js","sourceRoot":"","sources":["../../../../../packages/tooling/code-rules/src/rule-settings.ts"],"names":[],"mappings":";;;AAEA,oFAAoF;AACvE,QAAA,cAAc,GAA2C;IAClE,kBAAkB,EAAE;QAChB,OAAO,EAAE,EAAE;KACd;IACD,gBAAgB,EAAE;QACd,OAAO,EAAE,GAAG;KACf;IACD,qBAAqB,EAAE,EAAE;IACzB,yBAAyB,EAAE,EAAE;IAC7B,gBAAgB,EAAE,EAAE;IACpB,iBAAiB,EAAE,EAAE;IACrB,sBAAsB,EAAE,EAAE;IAC1B,kBAAkB,EAAE,EAAE;IACtB,gBAAgB,EAAE;QACd,eAAe,EAAE,IAAI;KACxB;IACD,qBAAqB,EAAE,EAAE;IACzB,yBAAyB,EAAE,EAAE;IAC7B,sBAAsB,EAAE,EAAE;IAC1B,mCAAmC,EAAE,EAAE;IACvC,qBAAqB,EAAE,EAAE;IACzB,6CAA6C,EAAE,EAAE;IACjD,eAAe,EAAE;QACb,YAAY,EAAE,EAAE;KACnB;IACD,6BAA6B,EAAE,EAAE;IACjC,8BAA8B,EAAE,EAAE;IAClC,2BAA2B,EAAE,EAAE;IAC/B,iDAAiD,EAAE,EAAE;IACrD,eAAe,EAAE;QACb,YAAY,EAAE;YACV,SAAS;YACT,OAAO;YACP,SAAS;YACT,MAAM;YACN,SAAS;YACT,cAAc;SACjB;KACJ;IACD,UAAU,EAAE;QACR,YAAY,EAAE;YACV,QAAQ;YACR,KAAK;YACL,QAAQ;YACR,c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EAAE,CAAC;QAC1B,0BAA0B,EAAE,IAAI;QAChC,SAAS,EAAE;YACP;gBACI,UAAU,EAAE;oBACR,YAAY;iBACf;gBACD,YAAY,EAAE;oBACV,SAAS;iBACZ;aACJ;YACD;gBACI,UAAU,EAAE;oBACR,OAAO;oBACP,cAAc;oBACd,OAAO;oBACP,SAAS;oBACT,sBAAsB;iBACzB;gBACD,YAAY,EAAE;oBACV,OAAO;oBACP,cAAc;iBACjB;aACJ;YACD;gBACI,UAAU,EAAE;oBACR,SAAS;oBACT,gBAAgB;oBAChB,YAAY;oBACZ,qBAAqB;oBACrB,iBAAiB;iBACpB;gBACD,YAAY,EAAE;oBACV,MAAM;oBACN,SAAS;iBACZ;aACJ;YACD;gBACI,UAAU,EAAE;oBACR,UAAU;iBACb;gBACD,YAAY,EAAE;oBACV,SAAS;oBACT,SAAS;oBACT,OAAO;iBACV;aACJ;SACJ;KACJ;CACJ,CAAC","sourcesContent":["import { ConfigObject } from '@webpieces/rules-sdk';\n\n/** Optional knobs only. Required behaviour is always supplied by the repository. */\nexport const optionalTuning: Readonly<Record<string, ConfigObject>> = {\n \"max-method-lines\": {\n \"limit\": 80\n },\n \"max-file-lines\": {\n \"limit\": 900\n },\n \"require-return-type\": {},\n \"no-inline-type-literals\": {},\n \"no-any-unknown\": {},\n \"no-implicit-any\": {},\n \"prisma-validate-dtos\": {},\n \"prisma-converter\": {},\n \"no-destructure\": {\n \"allowTopLevel\": true\n },\n \"catch-error-pattern\": {},\n \"no-unmanaged-exceptions\": {},\n \"catch-must-propagate\": {},\n \"angular-no-direct-api-in-resolver\": {},\n \"no-symbol-di-tokens\": {},\n \"no-client-creation-outside-server-or-client\": {},\n \"no-custom-css\": {\n \"allowGlobs\": []\n },\n \"no-state-paths-in-templates\": {},\n \"no-process-exit-outside-main\": {},\n \"no-function-outside-class\": {},\n \"inject-annotation-not-needed-for-concrete-class\": {},\n \"framework-tag\": {\n \"knownTypes\": [\n \"browser\",\n \"react\",\n \"angular\",\n \"node\",\n \"express\",\n \"react-native\"\n ]\n },\n \"role-tag\": {\n \"knownTypes\": [\n \"server\",\n \"app\",\n \"bundle\",\n \"designed-lib\",\n \"lib\",\n \"client\",\n \"api-lib\",\n \"api-client\"\n ]\n },\n \"ensure-we-are-secure\": {},\n \"no-inline-import-in-api-lib\": {},\n \"one-enum-spelling-in-api-lib\": {},\n \"no-utility-types-in-api-lib\": {},\n \"required-type-suffix\": {},\n \"framework-tsconfig\": {},\n \"framework-packages\": {}\n};\n\n/** Written for review by setup/sync; never used as a loader fallback. */\nexport const recommendedSeeds: Readonly<Record<string, ConfigObject>> = {\n \"max-method-lines\": {\n \"mode\": \"NEW_AND_MODIFIED_METHODS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"max-file-lines\": {\n \"mode\": \"NEW_AND_MODIFIED_FILES\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"require-return-type\": {\n \"mode\": \"NEW_AND_MODIFIED_METHODS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-inline-type-literals\": {\n \"mode\": \"NEW_AND_MODIFIED_METHODS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-any-unknown\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-implicit-any\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"prisma-validate-dtos\": {\n \"mode\": \"MODIFIED_CLASS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"prisma-converter\": {\n \"mode\": \"NEW_AND_MODIFIED_METHODS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-destructure\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"catch-error-pattern\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-unmanaged-exceptions\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"catch-must-propagate\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null,\n \"forwards\": [\n \"error\",\n \"warn\",\n \"info\",\n \"debug\",\n \"trace\",\n \"reject\",\n \"handleError\",\n \"reportError\",\n \"captureException\"\n ]\n },\n \"angular-no-direct-api-in-resolver\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-symbol-di-tokens\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-client-creation-outside-server-or-client\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-custom-css\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-state-paths-in-templates\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-process-exit-outside-main\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-function-outside-class\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"inject-annotation-not-needed-for-concrete-class\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"framework-tag\": {\n \"mode\": \"MODIFIED_PROJECTS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"role-tag\": {\n \"mode\": \"MODIFIED_PROJECTS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"ensure-we-are-secure\": {\n \"mode\": \"MODIFIED_PROJECTS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-inline-import-in-api-lib\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"one-enum-spelling-in-api-lib\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"no-utility-types-in-api-lib\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null,\n \"paths\": [\n \"libraries/apis/**\"\n ]\n },\n \"required-type-suffix\": {\n \"mode\": \"NEW_AND_MODIFIED_CODE\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null,\n \"entries\": [\n {\n \"paths\": [\n \"libraries/apis/**\"\n ],\n \"suffixes\": [\n \"Request\",\n \"Response\",\n \"Event\",\n \"Dto\",\n \"Api\"\n ],\n \"exempt\": false\n }\n ]\n },\n \"framework-tsconfig\": {\n \"mode\": \"MODIFIED_PROJECTS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null\n },\n \"framework-packages\": {\n \"mode\": \"MODIFIED_PROJECTS\",\n \"turnOffRuleUntilEpoch\": 0,\n \"turnOffRuleWhileOnBranch\": null,\n \"entries\": [\n {\n \"packages\": [\n \"@angular/*\"\n ],\n \"frameworks\": [\n \"angular\"\n ]\n },\n {\n \"packages\": [\n \"react\",\n \"react-native\",\n \"expo*\",\n \"@expo/*\",\n \"@sentry/react-native\"\n ],\n \"frameworks\": [\n \"react\",\n \"react-native\"\n ]\n },\n {\n \"packages\": [\n \"express\",\n \"firebase-admin\",\n \"googleapis\",\n \"google-auth-library\",\n \"@google-cloud/*\"\n ],\n \"frameworks\": [\n \"node\",\n \"express\"\n ]\n },\n {\n \"packages\": [\n \"firebase\"\n ],\n \"frameworks\": [\n \"browser\",\n \"angular\",\n \"react\"\n ]\n }\n ]\n }\n};\n"]}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * `catch-must-propagate` at the build gate (#1313) — the backstop for repos that do not run the guard
3
+ * hooks. It calls the SAME syntax-only `CatchPropagationAnalyzer` the Write/Edit guard calls, on the same
4
+ * whole-file parse, so both runners report the same catches at the same lines (pinned by the conformance
5
+ * spec in `@webpieces/webpieces-tooling`).
6
+ *
7
+ * Scoping follows the ApiLibSourceRule shape: NEW_AND_MODIFIED_CODE judges only a catch whose clause spans
8
+ * a changed line (existing catches are grandfathered until someone touches them), NEW_AND_MODIFIED_FILES
9
+ * every catch in a changed file, and the whole-scope modes (#1027) every catch of a touched project / the
10
+ * repo. A failure is ONE thrown `RuleFailError` with one `Option` per site, which `RuleReporter` renders.
11
+ */
12
+ import { DiffScope } from '@webpieces/rules-config';
13
+ import { CatchFinding, CatchPropagationAnalyzer } from '@webpieces/tooling-common/catch-propagation';
14
+ import { CatchMustPropagateConfig } from './configs/catch-must-propagate-config';
15
+ import { CodeValidator, ExecutorResult } from './code-validator';
16
+ import { ScanScope } from './scan-scope';
17
+ /** A finding located in its workspace-relative file. Data-only. */
18
+ export declare class LocatedCatchFinding {
19
+ readonly relFile: string;
20
+ readonly finding: CatchFinding;
21
+ constructor(relFile: string, finding: CatchFinding);
22
+ }
23
+ export declare class CatchMustPropagateValidator extends CodeValidator<CatchMustPropagateConfig> {
24
+ private readonly diffScope;
25
+ private readonly scanScope;
26
+ constructor(config: CatchMustPropagateConfig, diffScope: DiffScope, scanScope: ScanScope);
27
+ run(workspaceRoot: string): Promise<ExecutorResult>;
28
+ /** One file's findings: the whole text parsed, exactly as the guard parses the proposed file. */
29
+ judge(analyzer: CatchPropagationAnalyzer, workspaceRoot: string, relFile: string, changed?: ReadonlySet<number>): CatchFinding[];
30
+ /** Required by the owner schema; the loader refuses a config without it, so its absence is plumbing. */
31
+ private forwards;
32
+ private failure;
33
+ }
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ /**
3
+ * `catch-must-propagate` at the build gate (#1313) — the backstop for repos that do not run the guard
4
+ * hooks. It calls the SAME syntax-only `CatchPropagationAnalyzer` the Write/Edit guard calls, on the same
5
+ * whole-file parse, so both runners report the same catches at the same lines (pinned by the conformance
6
+ * spec in `@webpieces/webpieces-tooling`).
7
+ *
8
+ * Scoping follows the ApiLibSourceRule shape: NEW_AND_MODIFIED_CODE judges only a catch whose clause spans
9
+ * a changed line (existing catches are grandfathered until someone touches them), NEW_AND_MODIFIED_FILES
10
+ * every catch in a changed file, and the whole-scope modes (#1027) every catch of a touched project / the
11
+ * repo. A failure is ONE thrown `RuleFailError` with one `Option` per site, which `RuleReporter` renders.
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.CatchMustPropagateValidator = exports.LocatedCatchFinding = void 0;
15
+ const tslib_1 = require("tslib");
16
+ const fs = tslib_1.__importStar(require("fs"));
17
+ const path = tslib_1.__importStar(require("path"));
18
+ const ts = tslib_1.__importStar(require("typescript"));
19
+ const rules_config_1 = require("@webpieces/rules-config");
20
+ const tooling_common_1 = require("@webpieces/tooling-common");
21
+ const catch_propagation_1 = require("@webpieces/tooling-common/catch-propagation");
22
+ const inversify_1 = require("inversify");
23
+ const catch_must_propagate_config_1 = require("./configs/catch-must-propagate-config");
24
+ const code_validator_1 = require("./code-validator");
25
+ const scan_scope_1 = require("./scan-scope");
26
+ /** A finding located in its workspace-relative file. Data-only. */
27
+ class LocatedCatchFinding {
28
+ relFile;
29
+ finding;
30
+ constructor(relFile, finding) {
31
+ this.relFile = relFile;
32
+ this.finding = finding;
33
+ }
34
+ }
35
+ exports.LocatedCatchFinding = LocatedCatchFinding;
36
+ let CatchMustPropagateValidator = class CatchMustPropagateValidator extends code_validator_1.CodeValidator {
37
+ diffScope;
38
+ scanScope;
39
+ constructor(config, diffScope, scanScope) {
40
+ super(config, catch_propagation_1.CATCH_MUST_PROPAGATE, catch_propagation_1.CATCH_MUST_PROPAGATE);
41
+ this.diffScope = diffScope;
42
+ this.scanScope = scanScope;
43
+ }
44
+ async run(workspaceRoot) {
45
+ const mode = this.config.mode;
46
+ if (mode === undefined || mode === 'OFF')
47
+ return { success: true };
48
+ const range = this.diffScope.resolveBase(workspaceRoot);
49
+ if (range.base === undefined) {
50
+ console.log(`\n⏭️ Skipping ${this.name} validation (could not detect base branch)\n`);
51
+ return { success: true };
52
+ }
53
+ const analyzer = new catch_propagation_1.CatchPropagationAnalyzer(this.forwards());
54
+ const found = [];
55
+ for (const relFile of this.scanScope.files(workspaceRoot, mode, range.base, range.head)) {
56
+ if (!analyzer.judges(relFile) || !fs.existsSync(path.join(workspaceRoot, relFile)))
57
+ continue;
58
+ const changed = this.scanScope.isLineScoped(mode)
59
+ ? this.diffScope.getChangedLineNumbers(this.diffScope.getFileDiff(workspaceRoot, relFile, range.base, range.head))
60
+ : undefined;
61
+ if (changed !== undefined && changed.size === 0)
62
+ continue;
63
+ for (const finding of this.judge(analyzer, workspaceRoot, relFile, changed)) {
64
+ found.push(new LocatedCatchFinding(relFile, finding));
65
+ }
66
+ }
67
+ if (found.length === 0)
68
+ return { success: true };
69
+ this.scanScope.recordSites(this.name, found.map((each) => each.relFile));
70
+ throw this.failure(found);
71
+ }
72
+ /** One file's findings: the whole text parsed, exactly as the guard parses the proposed file. */
73
+ judge(analyzer, workspaceRoot, relFile, changed) {
74
+ const absFile = path.join(workspaceRoot, relFile);
75
+ const source = ts.createSourceFile(absFile, fs.readFileSync(absFile, 'utf8'), ts.ScriptTarget.Latest, true);
76
+ return analyzer.analyze(source, changed);
77
+ }
78
+ /** Required by the owner schema; the loader refuses a config without it, so its absence is plumbing. */
79
+ forwards() {
80
+ const forwards = this.config.forwards;
81
+ if (forwards === undefined) {
82
+ throw new tooling_common_1.InformAiError(`${catch_propagation_1.CATCH_MUST_PROPAGATE} has no "forwards" list. Add the required "forwards" array to its config entry.`);
83
+ }
84
+ return forwards;
85
+ }
86
+ failure(found) {
87
+ const message = `${found.length} catch(es) let the caught error go — its stack, type and cause chain are lost for good, ` +
88
+ `and a later refusal built from its text says nothing of WHY:\n` +
89
+ found.map((each) => ` ${each.relFile}:${each.finding.line} — ${each.finding.message}\n ${each.finding.snippet}`).join('\n') +
90
+ `\n Last resort, per site: ${catch_propagation_1.CATCH_MUST_PROPAGATE_DISABLE}`;
91
+ return new rules_config_1.RuleFailError(this.name, message, undefined, undefined, catch_propagation_1.CATCH_MUST_PROPAGATE_CURES.map((cure) => new rules_config_1.Option(cure.text, cure.preferred)));
92
+ }
93
+ };
94
+ exports.CatchMustPropagateValidator = CatchMustPropagateValidator;
95
+ exports.CatchMustPropagateValidator = CatchMustPropagateValidator = tslib_1.__decorate([
96
+ (0, inversify_1.injectable)(inversify_1.bindingScopeValues.Singleton),
97
+ tslib_1.__metadata("design:paramtypes", [catch_must_propagate_config_1.CatchMustPropagateConfig,
98
+ rules_config_1.DiffScope,
99
+ scan_scope_1.ScanScope])
100
+ ], CatchMustPropagateValidator);
101
+ //# sourceMappingURL=validate-catch-must-propagate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-catch-must-propagate.js","sourceRoot":"","sources":["../../../../../packages/tooling/code-rules/src/validate-catch-must-propagate.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;AAEH,+CAAyB;AACzB,mDAA6B;AAC7B,uDAAiC;AACjC,0DAA2E;AAE3E,8DAA0D;AAC1D,mFAOqD;AACrD,yCAA2D;AAC3D,uFAAiF;AACjF,qDAAiE;AACjE,6CAAyC;AAEzC,mEAAmE;AACnE,MAAa,mBAAmB;IAEf;IACA;IAFb,YACa,OAAe,EACf,OAAqB;QADrB,YAAO,GAAP,OAAO,CAAQ;QACf,YAAO,GAAP,OAAO,CAAc;IAC/B,CAAC;CACP;AALD,kDAKC;AAGM,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,8BAAuC;IAG/D;IACA;IAHrB,YACI,MAAgC,EACf,SAAoB,EACpB,SAAoB;QAErC,KAAK,CAAC,MAAM,EAAE,wCAAoB,EAAE,wCAAoB,CAAC,CAAC;QAHzC,cAAS,GAAT,SAAS,CAAW;QACpB,cAAS,GAAT,SAAS,CAAW;IAGzC,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,aAAqB;QAC3B,MAAM,IAAI,GAAiC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QAC5D,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,KAAK;YAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QACnE,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QACxD,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YAC3B,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,IAAI,8CAA8C,CAAC,CAAC;YACvF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC7B,CAAC;QACD,MAAM,QAAQ,GAAG,IAAI,4CAAwB,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC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,IAAI,CAAC,SAAS,CAAC,CAAC,CAC7F,CAAC;IACN,CAAC;CACJ,CAAA;AAjEY,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,sBAAU,EAAC,8BAAkB,CAAC,SAAS,CAAC;6CAGzB,sDAAwB;QACJ,wBAAS;QACT,sBAAS;GAJhC,2BAA2B,CAiEvC","sourcesContent":["/**\n * `catch-must-propagate` at the build gate (#1313) — the backstop for repos that do not run the guard\n * hooks. It calls the SAME syntax-only `CatchPropagationAnalyzer` the Write/Edit guard calls, on the same\n * whole-file parse, so both runners report the same catches at the same lines (pinned by the conformance\n * spec in `@webpieces/webpieces-tooling`).\n *\n * Scoping follows the ApiLibSourceRule shape: NEW_AND_MODIFIED_CODE judges only a catch whose clause spans\n * a changed line (existing catches are grandfathered until someone touches them), NEW_AND_MODIFIED_FILES\n * every catch in a changed file, and the whole-scope modes (#1027) every catch of a touched project / the\n * repo. A failure is ONE thrown `RuleFailError` with one `Option` per site, which `RuleReporter` renders.\n */\n\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport * as ts from 'typescript';\nimport { DiffScope, Option, RuleFailError } from '@webpieces/rules-config';\nimport { ModifiedCodeMode } from '@webpieces/rules-sdk';\nimport { InformAiError } from '@webpieces/tooling-common';\nimport {\n CATCH_MUST_PROPAGATE,\n CATCH_MUST_PROPAGATE_CURES,\n CATCH_MUST_PROPAGATE_DISABLE,\n CatchCure,\n CatchFinding,\n CatchPropagationAnalyzer,\n} from '@webpieces/tooling-common/catch-propagation';\nimport { injectable, bindingScopeValues } from 'inversify';\nimport { CatchMustPropagateConfig } from './configs/catch-must-propagate-config';\nimport { CodeValidator, ExecutorResult } from './code-validator';\nimport { ScanScope } from './scan-scope';\n\n/** A finding located in its workspace-relative file. Data-only. */\nexport class LocatedCatchFinding {\n constructor(\n readonly relFile: string,\n readonly finding: CatchFinding,\n ) {}\n}\n\n@injectable(bindingScopeValues.Singleton)\nexport class CatchMustPropagateValidator extends CodeValidator<CatchMustPropagateConfig> {\n constructor(\n config: CatchMustPropagateConfig,\n private readonly diffScope: DiffScope,\n private readonly scanScope: ScanScope,\n ) {\n super(config, CATCH_MUST_PROPAGATE, CATCH_MUST_PROPAGATE);\n }\n\n async run(workspaceRoot: string): Promise<ExecutorResult> {\n const mode: ModifiedCodeMode | undefined = this.config.mode;\n if (mode === undefined || mode === 'OFF') return { success: true };\n const range = this.diffScope.resolveBase(workspaceRoot);\n if (range.base === undefined) {\n console.log(`\\n⏭️ Skipping ${this.name} validation (could not detect base branch)\\n`);\n return { success: true };\n }\n const analyzer = new CatchPropagationAnalyzer(this.forwards());\n const found: LocatedCatchFinding[] = [];\n for (const relFile of this.scanScope.files(workspaceRoot, mode, range.base, range.head)) {\n if (!analyzer.judges(relFile) || !fs.existsSync(path.join(workspaceRoot, relFile))) continue;\n const changed = this.scanScope.isLineScoped(mode)\n ? this.diffScope.getChangedLineNumbers(this.diffScope.getFileDiff(workspaceRoot, relFile, range.base, range.head))\n : undefined;\n if (changed !== undefined && changed.size === 0) continue;\n for (const finding of this.judge(analyzer, workspaceRoot, relFile, changed)) {\n found.push(new LocatedCatchFinding(relFile, finding));\n }\n }\n if (found.length === 0) return { success: true };\n this.scanScope.recordSites(this.name, found.map((each: LocatedCatchFinding) => each.relFile));\n throw this.failure(found);\n }\n\n /** One file's findings: the whole text parsed, exactly as the guard parses the proposed file. */\n judge(analyzer: CatchPropagationAnalyzer, workspaceRoot: string, relFile: string, changed?: ReadonlySet<number>): CatchFinding[] {\n const absFile = path.join(workspaceRoot, relFile);\n const source = ts.createSourceFile(absFile, fs.readFileSync(absFile, 'utf8'), ts.ScriptTarget.Latest, true);\n return analyzer.analyze(source, changed);\n }\n\n /** Required by the owner schema; the loader refuses a config without it, so its absence is plumbing. */\n private forwards(): readonly string[] {\n const forwards = this.config.forwards;\n if (forwards === undefined) {\n throw new InformAiError(`${CATCH_MUST_PROPAGATE} has no \"forwards\" list. Add the required \"forwards\" array to its config entry.`);\n }\n return forwards;\n }\n\n private failure(found: readonly LocatedCatchFinding[]): RuleFailError {\n const message =\n `${found.length} catch(es) let the caught error go — its stack, type and cause chain are lost for good, ` +\n `and a later refusal built from its text says nothing of WHY:\\n` +\n found.map((each: LocatedCatchFinding) =>\n ` ${each.relFile}:${each.finding.line} — ${each.finding.message}\\n ${each.finding.snippet}`).join('\\n') +\n `\\n Last resort, per site: ${CATCH_MUST_PROPAGATE_DISABLE}`;\n return new RuleFailError(\n this.name,\n message,\n undefined,\n undefined,\n CATCH_MUST_PROPAGATE_CURES.map((cure: CatchCure) => new Option(cure.text, cure.preferred)),\n );\n }\n}\n"]}