no-restricted-patterns
A list of patterns to disallow globally, or specifically in features, rules, backgrounds, scenarios, or scenario outlines, Steps. All patterns are treated as case-insensitive
Configuration
Name | Type | Description | Default |
---|---|---|---|
Global | (string|RegExp)[] | Text patterns not allowed at any level | [] |
Feature | (string|RegExp)[] | Text patterns not allowed at Feature level | [] |
Rule | (string|RegExp)[] | Text patterns not allowed at Rule level | [] |
Background | (string|RegExp)[] | Text patterns not allowed at Background level | [] |
Scenario | (string|RegExp)[] | Text patterns not allowed at Scenario level | [] |
ScenarioOutline | (string|RegExp)[] | Text patterns not allowed at ScenarioOutline level | [] |
Examples | (string|RegExp)[] | Text patterns not allowed at Examples level | [] |
ExampleHeader | (string|RegExp)[] | Text patterns not allowed at ExampleHeader level | [] |
ExampleBody | (string|RegExp)[] | Text patterns not allowed at ExampleBody level | [] |
Step | (string|RegExp)[] | Text patterns not allowed at Step level | [] |
Given | (string|RegExp)[] | Text patterns not allowed at Given level | [] |
Examples
Example
Configure multiple patterns, mixing plain strings with RegExps
{
"no-restricted-patterns": [
"error",
{
"Global": [
"^globally restricted pattern"
],
"Feature": [
"poor description",
"validate",
"verify"
],
"Background": [
"show last response",
"a debugging step"
],
"Scenario": [
"show last response",
"a debugging step"
],
"Examples": [
"poor examples name",
"really bad examples description"
],
"ExampleHeader": [
"^.*disallowed.*$"
],
"ExampleBody": [
"^.*invalid.*$"
],
"Step": [
"bad step"
],
"Given": [
"bad step given",
"a debugging step given"
],
"When": [
"bad step when",
"a debugging step when"
],
"Then": [
"bad step then",
"a debugging step then"
],
"DocString": [
"^.*disallowed.*$"
],
"DataTable": [
"^.*invalid.*$",
"wrong value"
]
}
]
}