Skip to content

Commit

Permalink
feat(regexp): add eslint-plugin-regexp (#974)
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous authored Sep 2, 2021
1 parent 4be5433 commit c0163a7
Show file tree
Hide file tree
Showing 4 changed files with 192 additions and 9 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ module.exports = {
"./rules/core/variables.js",
"./rules/core/styles.js",
"./rules/core/es6.js",
"./rules/plugins/prettier.js",
"./rules/plugins/eslint-comments.js",
"./rules/plugins/import.js",
"./rules/plugins/regexp.js",
"./rules/plugins/prettier.js", // must be last
],
};
175 changes: 168 additions & 7 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-react": "^7.25.1",
"eslint-plugin-react-hooks": "^4.2.0"
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-regexp": "^1.1.0"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "*",
Expand Down Expand Up @@ -120,6 +121,7 @@
"node",
"prettier",
"react",
"regexp",
"typescript"
]
]
Expand Down
19 changes: 19 additions & 0 deletions rules/plugins/regexp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
extends: ["plugin:regexp/recommended"],

rules: {
"regexp/hexadecimal-escape": "off",
"regexp/letter-case": "off",
"regexp/no-octal": "error",
"regexp/no-standalone-backslash": "error",
"regexp/no-super-linear-move": "warn",
"regexp/prefer-escape-replacement-dollar-char": "error",
"regexp/prefer-named-backreference": "error",
"regexp/prefer-quantifier": "error",
"regexp/prefer-regexp-exec": "error",
"regexp/prefer-regexp-test": "error",
"regexp/sort-alternatives": "off",
"regexp/sort-character-class-elements": "warn",
"regexp/unicode-escape": "off",
},
};

0 comments on commit c0163a7

Please sign in to comment.