import { ConformancePatternRule , ErrorCode , PatternKind } from '../../third_party/tsetse/rules/conformance_pattern_rule' ; import { RuleConfiguration } from '../../rule_configuration' ; let errMsg = 'Use of legacy conversions to safe values requires security reviews and approval.' ; let bannedValues = [ '/node_modules/safevalues/restricted/legacy|legacyConversionToHtml' , '/node_modules/safevalues/restricted/legacy|legacyConversionToScript' , '/node_modules/safevalues/restricted/legacy|legacyConversionToScriptUrl' , '/node_modules/safevalues/unsafe/legacy|legacyConversionToHtml' , '/node_modules/safevalues/unsafe/legacy|legacyConversionToScript' , '/node_modules/safevalues/unsafe/legacy|legacyConversionToScriptUrl' , ] ; /** A Rule that bans the use of legacy conversions to safe values. */ export class Rule extends ConformancePatternRule { static readonly RULE_NAME = 'ban-legacy-conversions' ; constructor ( configuration = { } ) { super ( { errorCode : ErrorCode . CONFORMANCE_PATTERN , errorMessage : errMsg , values : bannedValues , kind : PatternKind . BANNED_NAME , name : Rule . RULE_NAME , ... configuration , } ) ; } }