Package com.google.javascript.jscomp
Class ConformanceRules.BannedEnhance
- java.lang.Object
-
- com.google.javascript.jscomp.ConformanceRules.AbstractRule
-
- com.google.javascript.jscomp.ConformanceRules.BannedEnhance
-
- All Implemented Interfaces:
CheckConformance.Rule
- Enclosing class:
- ConformanceRules
public static final class ConformanceRules.BannedEnhance extends ConformanceRules.AbstractRule
Checks that file does not include an @enhance annotation for a banned namespace.
-
-
Constructor Summary
Constructors Constructor Description BannedEnhance(AbstractCompiler compiler, com.google.javascript.jscomp.Requirement requirement)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ConformanceRules.ConformanceResult
checkConformance(NodeTraversal t, Node n)
CheckConformance.Precondition
getPrecondition()
Return a precondition for this rule.-
Methods inherited from class com.google.javascript.jscomp.ConformanceRules.AbstractRule
check, report, tsIsAllowlisted
-
-
-
-
Constructor Detail
-
BannedEnhance
public BannedEnhance(AbstractCompiler compiler, com.google.javascript.jscomp.Requirement requirement) throws CheckConformance.InvalidRequirementSpec
-
-
Method Detail
-
checkConformance
protected ConformanceRules.ConformanceResult checkConformance(NodeTraversal t, Node n)
- Specified by:
checkConformance
in classConformanceRules.AbstractRule
- Returns:
- Whether the code represented by the Node conforms to the rule.
-
getPrecondition
public final CheckConformance.Precondition getPrecondition()
Description copied from interface:CheckConformance.Rule
Return a precondition for this rule.This method will only be called once (per rule) during the creation of the CheckConformance pass. Therefore, the return must be constant.
Returning null means that there is no precondition. This is convenient, but can be a major performance hit.
-
-