mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Remove RegExp lookbehind assertions used to fix "Polynomial regular expression used on uncontrolled data" because they are not supported in Safari, add eslint-plugin-es rule no-regexp-lookbehind-assertions to prevent regressions.
This commit is contained in:
parent
f46ee0732f
commit
7c1550cbe9
5 changed files with 9 additions and 5 deletions
|
|
@ -53,6 +53,7 @@
|
|||
"sourceType": "script"
|
||||
},
|
||||
"plugins": [
|
||||
"es",
|
||||
"jsdoc",
|
||||
"node",
|
||||
"unicorn"
|
||||
|
|
@ -105,6 +106,8 @@
|
|||
"vars-on-top": "off",
|
||||
"wrap-regex": "off",
|
||||
|
||||
"es/no-regexp-lookbehind-assertions": "error",
|
||||
|
||||
"jsdoc/check-access": "error",
|
||||
"jsdoc/check-alignment": "error",
|
||||
"jsdoc/check-examples": "off",
|
||||
|
|
|
|||
|
|
@ -50,11 +50,11 @@ module.exports.orderedListItemMarkerRe = /^[\s>]*0*(\d+)[.)]/;
|
|||
// Regular expression for all instances of emphasis markers
|
||||
var emphasisMarkersRe = /[_*]/g;
|
||||
// Regular expression for inline links and shortcut reference links
|
||||
var linkRe = /(?:|(?<![^[]))(\[(?:[^[\]]?(?:\[[^[\]]*\])?)*\])(\([^)]*\)|\[[^\]]*\])?/g;
|
||||
var linkRe = /(\[(?:[^[\]]?(?:\[[^[\]]*\])?)*\])(\([^)]*\)|\[[^\]]*\])?/g;
|
||||
module.exports.linkRe = linkRe;
|
||||
// Regular expression for empty inline links
|
||||
module.exports.emptyLinkRe =
|
||||
/(?:|(?<![^[]))\[(?:[^[\]]?(?:\[[^[\]]*\])?)*\]\((?:|#|<>)\)/;
|
||||
/\[(?:[^[\]]?(?:\[[^[\]]*\])?)*\]\((?:|#|<>)\)/;
|
||||
// Regular expression for link reference definition lines
|
||||
module.exports.linkReferenceRe = /^ {0,3}\[[^\]]+]:\s.*$/;
|
||||
// All punctuation characters (normal and full-width)
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@ const emphasisMarkersRe = /[_*]/g;
|
|||
|
||||
// Regular expression for inline links and shortcut reference links
|
||||
const linkRe =
|
||||
/(?:|(?<![^[]))(\[(?:[^[\]]?(?:\[[^[\]]*\])?)*\])(\([^)]*\)|\[[^\]]*\])?/g;
|
||||
/(\[(?:[^[\]]?(?:\[[^[\]]*\])?)*\])(\([^)]*\)|\[[^\]]*\])?/g;
|
||||
module.exports.linkRe = linkRe;
|
||||
|
||||
// Regular expression for empty inline links
|
||||
module.exports.emptyLinkRe =
|
||||
/(?:|(?<![^[]))\[(?:[^[\]]?(?:\[[^[\]]*\])?)*\]\((?:|#|<>)\)/;
|
||||
/\[(?:[^[\]]?(?:\[[^[\]]*\])?)*\]\((?:|#|<>)\)/;
|
||||
|
||||
// Regular expression for link reference definition lines
|
||||
module.exports.linkReferenceRe = /^ {0,3}\[[^\]]+]:\s.*$/;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@
|
|||
"ava": "3.15.0",
|
||||
"c8": "7.10.0",
|
||||
"eslint": "8.5.0",
|
||||
"eslint-plugin-es": "4.1.0",
|
||||
"eslint-plugin-jsdoc": "37.4.0",
|
||||
"eslint-plugin-node": "11.1.0",
|
||||
"eslint-plugin-unicorn": "39.0.0",
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ const languageJavaScript = /js|javascript/i;
|
|||
function cleanJsdocRulesFromEslintConfig(config) {
|
||||
const cleanedConfig = { ...config };
|
||||
for (const rule in config.rules) {
|
||||
if (/^(jsdoc|node|unicorn)\//.test(rule)) {
|
||||
if (/^(es|jsdoc|node|unicorn)\//.test(rule)) {
|
||||
delete cleanedConfig.rules[rule];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue