Package com.google.javascript.jscomp
Class ConformanceRules.BannedModsRegex
- java.lang.Object
-
- com.google.javascript.jscomp.ConformanceRules.AbstractRule
-
- com.google.javascript.jscomp.ConformanceRules.BannedModsRegex
-
- All Implemented Interfaces:
CheckConformance.Rule
- Enclosing class:
- ConformanceRules
public static final class ConformanceRules.BannedModsRegex extends ConformanceRules.AbstractRule
Checks that file does not include an @mods annotation for a banned namespace regex.
-
-
Constructor Summary
Constructors Constructor Description BannedModsRegex(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
-
BannedModsRegex
public BannedModsRegex(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.
-
-