diff --git a/package.json b/package.json index e68021884..8b69ac2fc 100644 --- a/package.json +++ b/package.json @@ -26,10 +26,10 @@ "unified": "^8.3.2", "unist-builder": "^1.0.4", "unist-util-remove-position": "^1.1.0", - "unist-util-visit": "^1.4.1", + "unist-util-visit": "^2.0.0", "vfile": "^4.0.1", "wcwidth": "^1.0.1", - "xo": "^0.24.0" + "xo": "^0.25.0" }, "scripts": { "postinstall": "lerna bootstrap --no-ci", @@ -62,6 +62,8 @@ "esnext": false, "rules": { "unicorn/prefer-type-error": "off", + "unicorn/prefer-reflect-apply": "off", + "unicorn/prefer-includes": "off", "eqeqeq": [ "error", "always", diff --git a/packages/remark-parse/lib/tokenize/auto-link.js b/packages/remark-parse/lib/tokenize/auto-link.js index c73480f41..f5bcb8900 100644 --- a/packages/remark-parse/lib/tokenize/auto-link.js +++ b/packages/remark-parse/lib/tokenize/auto-link.js @@ -105,7 +105,7 @@ function autoLink(eat, value, silent) { if (hasAtCharacter) { if (link.slice(0, mailtoLength).toLowerCase() === mailto) { - content = content.substr(mailtoLength) + content = content.slice(mailtoLength) now.column += mailtoLength now.offset += mailtoLength } else { diff --git a/packages/remark-parse/lib/tokenize/url.js b/packages/remark-parse/lib/tokenize/url.js index ee72e6638..92d1c6229 100644 --- a/packages/remark-parse/lib/tokenize/url.js +++ b/packages/remark-parse/lib/tokenize/url.js @@ -125,7 +125,7 @@ function url(eat, value, silent) { return } - content = content.substr(mailto.length) + content = content.slice(mailto.length) } /* istanbul ignore if - never used (yet) */ diff --git a/packages/remark-parse/lib/tokenizer.js b/packages/remark-parse/lib/tokenizer.js index a9edf5d66..a4e2b4cf9 100644 --- a/packages/remark-parse/lib/tokenizer.js +++ b/packages/remark-parse/lib/tokenizer.js @@ -141,7 +141,7 @@ function factory(type) { // throw on new, incorrect rules. function validateEat(subvalue) { /* istanbul ignore if */ - if (value.substring(0, subvalue.length) !== subvalue) { + if (value.slice(0, subvalue.length) !== subvalue) { // Capture stack-trace. self.file.fail( new Error( @@ -235,7 +235,7 @@ function factory(type) { reset.test = test apply.test = test - value = value.substring(subvalue.length) + value = value.slice(subvalue.length) updatePosition(subvalue)