Skip to content

Commit

Permalink
Merge pull request #93 from tjenkinson/redos-eslint
Browse files Browse the repository at this point in the history
Configure `eslint-plugin-redos-detector`
  • Loading branch information
tjenkinson authored May 29, 2022
2 parents 16de84a + a394b6b commit 92f9469
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = {
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier',
],
plugins: ['redos-detector'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2019,
Expand Down Expand Up @@ -44,5 +45,6 @@ module.exports = {
'@typescript-eslint/no-loss-of-precision': ['error'],
'@typescript-eslint/no-throw-literal': ['error'],
'@typescript-eslint/no-unused-expressions': ['error'],
'redos-detector/no-unsafe-regex': ['error'],
},
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
/dist
.DS_STORE
/src/coverage
.eslintcache
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"scripts": {
"build": "rm -rf dist && rollup --config rollup.config.js",
"watch": "rollup --config rollup.config.js --watch",
"lint": "eslint --ext .ts --max-warnings 0 src",
"lint": "eslint --ext .ts --max-warnings 0 --cache src",
"prettier": "prettier --write .",
"prettier:check": "prettier --check .",
"test": "jest",
Expand Down Expand Up @@ -50,6 +50,7 @@
"commander": "9.2.0",
"eslint": "8.16.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-redos-detector": "2.0.12",
"husky": "8.0.1",
"jest": "28.1.0",
"lint-staged": "12.4.1",
Expand Down
4 changes: 4 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
"vulnerabilityAlerts": true,
"rangeStrategy": "bump",
"packageRules": [
{
"matchPackageNames": ["eslint-plugin-redos-detector"],
"stabilityDays": 0
},
{
"matchPackageNames": ["regjsparser"],
"rangeStrategy": "pin"
Expand Down
2 changes: 1 addition & 1 deletion src/downgrade-pattern.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-useless-backreference */
/* eslint-disable no-useless-backreference, redos-detector/no-unsafe-regex */
import {
DowngradedRegexPattern,
downgradePattern,
Expand Down
2 changes: 1 addition & 1 deletion src/redos-detector.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable no-control-regex, no-useless-backreference */
/* eslint-disable no-control-regex, no-useless-backreference, redos-detector/no-unsafe-regex */
import {
downgradePattern,
isSafe,
Expand Down

0 comments on commit 92f9469

Please sign in to comment.