Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (original.docs.subclassable && !updated.docs.subclassable) {
context.mismatches.report({
ruleKey: 'remove-subclassable',
message: 'has gone from @subclassable to non-@subclassable',
violator: original,
});
}
for (const [origMethod, updatedElement] of memberPairs(original, original.allMethods, updated, context)) {
if (reflect.isMethod(origMethod) && reflect.isMethod(updatedElement)) {
compareMethod(origMethod, updatedElement, context);
}
}
for (const [origProp, updatedElement] of memberPairs(original, original.allProperties, updated, context)) {
if (reflect.isProperty(origProp) && reflect.isProperty(updatedElement)) {
compareProperty(origProp, updatedElement, context);
}
}
// You cannot have added abstract members to the class/interface, as they are
// an added burden on potential implementors.
//
// Only for types that are explicitly marked as intended to be subclassed by customers.
if (subclassableType(original)) {
noNewAbstractMembers(original, updated, context);
}
}