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