mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
Manually fix three new ESLint warnings from the eslint-plugin-regexp plugin (refs #657).
This commit is contained in:
parent
6b01a98363
commit
868edf889e
9 changed files with 13 additions and 16 deletions
|
@ -201,10 +201,7 @@
|
|||
"n/prefer-promises/dns": "error",
|
||||
"n/prefer-promises/fs": "error",
|
||||
|
||||
"regexp/no-empty-alternative": "off",
|
||||
"regexp/no-super-linear-backtracking": "off",
|
||||
"regexp/no-unused-capturing-group": "off",
|
||||
"regexp/no-useless-assertions": "off",
|
||||
|
||||
"unicorn/better-regex": "off",
|
||||
"unicorn/consistent-function-scoping": "off",
|
||||
|
|
|
@ -513,7 +513,7 @@ The default value:
|
|||
<!-- markdownlint-disable line-length -->
|
||||
|
||||
```javascript
|
||||
/((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$)|(^\{\s*$[^]*?^\}\s*$))(\r\n|\r|\n|$)/m
|
||||
/((^---\s*$[\s\S]*?^---\s*)|(^\+\+\+\s*$[\s\S]*?^(\+\+\+|\.\.\.)\s*)|(^\{\s*$[\s\S]*?^\}\s*))(\r\n|\r|\n|$)/m
|
||||
```
|
||||
|
||||
<!-- markdownlint-restore -->
|
||||
|
|
|
@ -37,7 +37,7 @@ module.exports.newLineRe = newLineRe;
|
|||
// Regular expression for matching common front matter (YAML and TOML)
|
||||
module.exports.frontMatterRe =
|
||||
// eslint-disable-next-line max-len
|
||||
/((^---\s*$[\s\S]*?^---\s*$)|(^\+\+\+\s*$[\s\S]*?^(\+\+\+|\.\.\.)\s*$)|(^\{\s*$[\s\S]*?^\}\s*$))(\r\n|\r|\n|$)/m;
|
||||
/((^---\s*$[\s\S]*?^---\s*)|(^\+\+\+\s*$[\s\S]*?^(\+\+\+|\.\.\.)\s*)|(^\{\s*$[\s\S]*?^\}\s*))(\r\n|\r|\n|$)/m;
|
||||
// Regular expression for matching the start of inline disable/enable comments
|
||||
const inlineCommentStartRe =
|
||||
// eslint-disable-next-line max-len
|
||||
|
@ -2980,8 +2980,8 @@ const { lineMetadata, referenceLinkImageData } = __webpack_require__(/*! ./cache
|
|||
const longLineRePrefix = "^.{";
|
||||
const longLineRePostfixRelaxed = "}.*\\s.*$";
|
||||
const longLineRePostfixStrict = "}.+$";
|
||||
const linkOrImageOnlyLineRe = /^[es]*(lT?L|I)[ES]*$/;
|
||||
const sternModeRe = /^([#>\s]*\s)?\S*$/;
|
||||
const linkOrImageOnlyLineRe = /^[es]*(?:lT?L|I)[ES]*$/;
|
||||
const sternModeRe = /^(?:[#>\s]*\s)?\S*$/;
|
||||
const tokenTypeMap = {
|
||||
"em_open": "e",
|
||||
"em_close": "E",
|
||||
|
@ -3858,7 +3858,7 @@ module.exports = {
|
|||
|
||||
const { addErrorContext, filterTokens, funcExpExec, urlFe, withinAnyRange } = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js");
|
||||
const { codeBlockAndSpanRanges, htmlElementRanges, referenceLinkImageData } = __webpack_require__(/*! ./cache */ "../lib/cache.js");
|
||||
const htmlLinkRe = /<a(?:|\s[^>]+)>[^<>]*<\/a\s*>/gi;
|
||||
const htmlLinkRe = /<a(?:\s[^>]*)?>[^<>]*<\/a\s*>/gi;
|
||||
module.exports = {
|
||||
"names": ["MD034", "no-bare-urls"],
|
||||
"description": "Bare URL used",
|
||||
|
@ -4208,7 +4208,7 @@ module.exports = {
|
|||
// @ts-check
|
||||
|
||||
const { addErrorContext, filterTokens, forEachInlineCodeSpan, newLineRe } = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js");
|
||||
const leftSpaceRe = /^\s([^`]|$)/;
|
||||
const leftSpaceRe = /^\s(?:[^`]|$)/;
|
||||
const rightSpaceRe = /[^`]\s$/;
|
||||
const spaceInsideCodeInline = (token) => ((token.type === "code_inline") &&
|
||||
(leftSpaceRe.test(token.content) || rightSpaceRe.test(token.content)));
|
||||
|
|
|
@ -10,7 +10,7 @@ module.exports.newLineRe = newLineRe;
|
|||
// Regular expression for matching common front matter (YAML and TOML)
|
||||
module.exports.frontMatterRe =
|
||||
// eslint-disable-next-line max-len
|
||||
/((^---\s*$[\s\S]*?^---\s*$)|(^\+\+\+\s*$[\s\S]*?^(\+\+\+|\.\.\.)\s*$)|(^\{\s*$[\s\S]*?^\}\s*$))(\r\n|\r|\n|$)/m;
|
||||
/((^---\s*$[\s\S]*?^---\s*)|(^\+\+\+\s*$[\s\S]*?^(\+\+\+|\.\.\.)\s*)|(^\{\s*$[\s\S]*?^\}\s*))(\r\n|\r|\n|$)/m;
|
||||
|
||||
// Regular expression for matching the start of inline disable/enable comments
|
||||
const inlineCommentStartRe =
|
||||
|
|
|
@ -9,8 +9,8 @@ const { lineMetadata, referenceLinkImageData } = require("./cache");
|
|||
const longLineRePrefix = "^.{";
|
||||
const longLineRePostfixRelaxed = "}.*\\s.*$";
|
||||
const longLineRePostfixStrict = "}.+$";
|
||||
const linkOrImageOnlyLineRe = /^[es]*(lT?L|I)[ES]*$/;
|
||||
const sternModeRe = /^([#>\s]*\s)?\S*$/;
|
||||
const linkOrImageOnlyLineRe = /^[es]*(?:lT?L|I)[ES]*$/;
|
||||
const sternModeRe = /^(?:[#>\s]*\s)?\S*$/;
|
||||
const tokenTypeMap = {
|
||||
"em_open": "e",
|
||||
"em_close": "E",
|
||||
|
|
|
@ -7,7 +7,7 @@ const { addErrorContext, filterTokens, funcExpExec, urlFe, withinAnyRange } =
|
|||
const { codeBlockAndSpanRanges, htmlElementRanges, referenceLinkImageData } =
|
||||
require("./cache");
|
||||
|
||||
const htmlLinkRe = /<a(?:|\s[^>]+)>[^<>]*<\/a\s*>/gi;
|
||||
const htmlLinkRe = /<a(?:\s[^>]*)?>[^<>]*<\/a\s*>/gi;
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD034", "no-bare-urls" ],
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
const { addErrorContext, filterTokens, forEachInlineCodeSpan, newLineRe } =
|
||||
require("../helpers");
|
||||
|
||||
const leftSpaceRe = /^\s([^`]|$)/;
|
||||
const leftSpaceRe = /^\s(?:[^`]|$)/;
|
||||
const rightSpaceRe = /[^`]\s$/;
|
||||
|
||||
const spaceInsideCodeInline = (token) => (
|
||||
|
|
|
@ -8,7 +8,7 @@ const configSchema = require("./markdownlint-config-schema.json");
|
|||
|
||||
const configExample = {};
|
||||
for (const rule in configSchema.properties) {
|
||||
if (/^(MD\d{3}|default|extends)$/.test(rule)) {
|
||||
if (/^(?:MD\d{3}|default|extends)$/.test(rule)) {
|
||||
const properties = configSchema.properties[rule];
|
||||
configExample[rule + "-description"] = properties.description;
|
||||
configExample[rule] = properties.default;
|
||||
|
|
|
@ -17,7 +17,7 @@ const languageJavaScript = /js|javascript/i;
|
|||
function cleanJsdocRulesFromEslintConfig(config) {
|
||||
const cleanedConfig = { ...config };
|
||||
for (const rule in config.rules) {
|
||||
if (/^(es|jsdoc|n|regexp|unicorn)\//.test(rule)) {
|
||||
if (/^(?:es|jsdoc|n|regexp|unicorn)\//.test(rule)) {
|
||||
delete cleanedConfig.rules[rule];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue