eslint-plugin-regex weekly downloads statistics
By gmullerb · npm · ESLint plugins
ESLint rules using Regular Expression
eslint-plugin-regex has 357,985 recorded weekly downloads on npm, an increase of 80.2% over the past 30 days, ranking #442 of 3,247 tracked listings.
About eslint-plugin-regex
Quick Start
1 . Add dependencies:
package.json:
"engines" : {
"node" : ">=6.0.0"
},
"devDependencies": {
"eslint": ">=4.0.0",
"eslint-plugin-regex": "1.10.0",
2 . Configure eslint:
Short configuration:
.eslintrc.json:
{
"plugins": [
"regex"
],
"rules": {
"regex/invalid": [
"error", [
"invalidRegex1",
"invalidRegexN"
]
],
"regex/required": [
"error", [
"requiredRegex1",
"requiredRegexN"
],
"ignoreFilesRegex"
]
}
}
Files will be checked for the absence of invalidRegex1 and invalidRegexN, and for the presence of requiredRegex1 and requiredRegexN, and files with name matching ignoreFilesRegex will not be checked.
Detailed configuration:
.eslintrc.json:
{
"plugins": [
"regex"
],
"rules": {
"regex/invalid": [
"error", [{
"regex": "invalidRegex1",
"replacement": "newValue"
}, {
"id": "regexIdN",
"message": "errorMessageN",
"regex": "invalidRegexN",
"files": {
"ignore": "ignoreFilesRegexN"
}
}
]
],
"regex/required": [
"error", [{
"id": "regexId1",
"regex": "requiredRegex1",
"message": "errorMessage1",
"files": {
"inspect": "inspectFilesRegex1"
}
}, {
"regex": "requiredRegexN",
"files": {
"ignore": "ignoreFilesRegexA",
"inspect": "inspectFilesRegexZ"
}
}
]
]
}
}
Files will be checked for:
- The absence of
invalidRegex1but if found it will be replaced withnewValue. - The absence of
invalidRegexNonly in files with name not matchingignoreFilesRegexN, but if founderrorMessageNwill be shown. - The presence of
requiredRegex1only in files with name matchinginspectFilesRegex1, but if not founderrorMessage1will be shown. - The presence of
requiredRegexNonly in files with name matchinginspectFilesRegexAand not matchingignoreFilesRegexZ.
Goals
The idea is to allow the creation of different eslint rules based on Regular Expressions in order to have some "freedom" to create quick ESLint custom rules.
Rules
| Name | Fixable | Description |
|---|---|---|
regex/invalid | Yes | checks that specified patterns are not found |
regex/required | No | checks that specified patterns are found |
Each rule defines a set of patterns:
📏 regex/invalid
This rule checks that specified patterns are not found in files, i.e. Invalid patterns.
✏ Example of incorrect code for this rule:
/* eslint regex/invalid: ['error', ['"']] */
const text = 'Hello "My Friend"'
The error message will reflect the exact location, e.g.:
/path/to/some.js
34:25 error Invalid regular expression /"/gm found regex/invalid
✏ Example of correct code for this rule:
/* eslint regex/invalid: ['error', ['"']] */
const text = 'Hello \'My Friend\''
📏 regex/required
This rule looks for specific patterns that must be present in each file, i.e. Required patterns.
✏ Example of incorrect code for this rule:
/* eslint regex/required: ["error", ["^// Copyright My Friend"]] */
const text = 'Hello "My Friend"'
The error message will point to the beginning of the file, e.g.:
/path/to/some.js
1:1 error Required regular expression /^\/\/ Copyright My Friend/gm not found in file regex/required
✏ Example of correct code for this rule:
/* eslint regex/required: ["error", ["^// Copyright My Friend"]] */
// Copyright My Friend
const text = 'Hello "My Friend"'
Options
Both rule has two options:
- array of patterns definitions to analyze. [REQUIRED]
- Each pattern definition can be 'Short' or 'Detailed'.
- a string representing the regular expression for ignoring files for all patterns. [OPTIONAL]
[
"error",
[
"regex1",
"regexN"
],
"ignoreFilesRegex"
]
The string representing the regular expression
Remember, Slashes (/) are not required in the string that defines the regex,
e.g. To get the following regex /^(test|spec)$/, define:
"^(test|spec)$", when using.eslintrc.jsor.eslintrc.json.
e.g. To get the following regex /\bhttp:/, define:
"\bhttp:", when using.eslintrc.js, or"\\bhttp:", when using.eslintrc.json. (backslash needs to be double in a json file)
e.g. To get the following regex /.*test\.js/, define:…
Description from the npm listing.
- eslint-plugin-regex
- eslint
- regex-rule
- regex
- regexp
- eslint-regex
- eslint-rule
- eslint-regex-rule
- rule
- expression
- regular-expression
- eslint-regular-expression
- eslint-regular-expression-rule
- eslintrule
- regular-expression-rule
- eslintplugin
- eslint-plugin
- plugin
- coding style
- coding standards
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm ESLint plugins plugins
All 20 eslint-plugin-regex alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/eslint-plugin-regex. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.