Add ESLint plugin eslint-plugin-regexp, enable recommended rules, apply all automated fixes (refs #657).

This commit is contained in:
David Anson 2022-12-19 21:36:24 -08:00
parent c346e0dbac
commit 6b01a98363
15 changed files with 41 additions and 34 deletions

View file

@ -7,6 +7,7 @@
"eslint:all", "eslint:all",
"plugin:jsdoc/recommended", "plugin:jsdoc/recommended",
"plugin:n/recommended", "plugin:n/recommended",
"plugin:regexp/recommended",
"plugin:unicorn/all" "plugin:unicorn/all"
], ],
"ignorePatterns": [ "ignorePatterns": [
@ -200,6 +201,11 @@
"n/prefer-promises/dns": "error", "n/prefer-promises/dns": "error",
"n/prefer-promises/fs": "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/better-regex": "off",
"unicorn/consistent-function-scoping": "off", "unicorn/consistent-function-scoping": "off",
"unicorn/filename-case": "off", "unicorn/filename-case": "off",

View file

@ -37,14 +37,14 @@ module.exports.newLineRe = newLineRe;
// Regular expression for matching common front matter (YAML and TOML) // Regular expression for matching common front matter (YAML and TOML)
module.exports.frontMatterRe = module.exports.frontMatterRe =
// eslint-disable-next-line max-len // eslint-disable-next-line max-len
/((^---\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 // Regular expression for matching the start of inline disable/enable comments
const inlineCommentStartRe = const inlineCommentStartRe =
// eslint-disable-next-line max-len // eslint-disable-next-line max-len
/(<!--\s*markdownlint-(disable|enable|capture|restore|disable-file|enable-file|disable-line|disable-next-line|configure-file))(?:\s|-->)/ig; /(<!--\s*markdownlint-(disable|enable|capture|restore|disable-file|enable-file|disable-line|disable-next-line|configure-file))(?:\s|-->)/gi;
module.exports.inlineCommentStartRe = inlineCommentStartRe; module.exports.inlineCommentStartRe = inlineCommentStartRe;
// Regular expression for matching HTML elements // Regular expression for matching HTML elements
const htmlElementRe = /<(([A-Za-z][A-Za-z0-9-]*)(?:\s[^`>]*)?)\/?>/g; const htmlElementRe = /<(([A-Za-z][A-Za-z\d-]*)(?:\s[^`>]*)?)\/?>/g;
module.exports.htmlElementRe = htmlElementRe; module.exports.htmlElementRe = htmlElementRe;
// Regular expressions for range matching // Regular expressions for range matching
module.exports.listItemMarkerRe = /^([\s>]*)(?:[*+-]|\d+[.)])\s+/; module.exports.listItemMarkerRe = /^([\s>]*)(?:[*+-]|\d+[.)])\s+/;
@ -55,9 +55,9 @@ const emphasisMarkersRe = /[_*]/g;
const blockquotePrefixRe = /^[>\s]*/; const blockquotePrefixRe = /^[>\s]*/;
module.exports.blockquotePrefixRe = blockquotePrefixRe; module.exports.blockquotePrefixRe = blockquotePrefixRe;
// Regular expression for reference links (full, collapsed, and shortcut) // Regular expression for reference links (full, collapsed, and shortcut)
const referenceLinkRe = /!?\\?\[((?:\[[^\]\0]*]|[^[\]\0])*)](?:(?:\[([^\]\0]*)\])|([^(])|$)/g; const referenceLinkRe = /!?\\?\[((?:\[[^\]\0]*\]|[^[\]\0])*)\](?:\[([^\]\0]*)\]|([^(])|$)/g;
// Regular expression for link reference definitions // Regular expression for link reference definitions
const linkReferenceDefinitionRe = /^ {0,3}\[([^\]]*[^\\])]:/; const linkReferenceDefinitionRe = /^ {0,3}\[([^\]]*[^\\])\]:/;
module.exports.linkReferenceDefinitionRe = linkReferenceDefinitionRe; module.exports.linkReferenceDefinitionRe = linkReferenceDefinitionRe;
// All punctuation characters (normal and full-width) // All punctuation characters (normal and full-width)
const allPunctuation = ".,;:!?。,;:!?"; const allPunctuation = ".,;:!?。,;:!?";
@ -2902,7 +2902,7 @@ module.exports = {
const { addError, forEachLine, withinAnyRange } = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"); const { addError, forEachLine, withinAnyRange } = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js");
const { codeBlockAndSpanRanges, lineMetadata } = __webpack_require__(/*! ./cache */ "../lib/cache.js"); const { codeBlockAndSpanRanges, lineMetadata } = __webpack_require__(/*! ./cache */ "../lib/cache.js");
const reversedLinkRe = /(^|[^\\])\(([^()]+)\)\[([^\]^][^\]]*)](?!\()/g; const reversedLinkRe = /(^|[^\\])\(([^()]+)\)\[([^\]^][^\]]*)\](?!\()/g;
module.exports = { module.exports = {
"names": ["MD011", "no-reversed-links"], "names": ["MD011", "no-reversed-links"],
"description": "Reversed link syntax", "description": "Reversed link syntax",
@ -3163,7 +3163,7 @@ module.exports = {
filterTokens(params, "heading_open", (token) => { filterTokens(params, "heading_open", (token) => {
if (headingStyleFor(token) === "atx") { if (headingStyleFor(token) === "atx") {
const { line, lineNumber } = token; const { line, lineNumber } = token;
const match = /^(#+)([ \t]{2,})(?:\S)/.exec(line); const match = /^(#+)([ \t]{2,})\S/.exec(line);
if (match) { if (match) {
const [, { "length": hashLength }, { "length": spacesLength }] = match; const [, { "length": hashLength }, { "length": spacesLength }] = match;
addErrorContext(onError, lineNumber, line.trim(), null, null, [1, hashLength + spacesLength + 1], { addErrorContext(onError, lineNumber, line.trim(), null, null, [1, hashLength + spacesLength + 1], {
@ -3346,7 +3346,7 @@ module.exports = {
// @ts-check // @ts-check
const { addErrorContext, filterTokens } = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"); const { addErrorContext, filterTokens } = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js");
const spaceBeforeHeadingRe = /^((?:\s+)|(?:[>\s]+\s\s))[^>\s]/; const spaceBeforeHeadingRe = /^(\s+|[>\s]+\s\s)[^>\s]/;
module.exports = { module.exports = {
"names": ["MD023", "heading-start-left", "header-start-left"], "names": ["MD023", "heading-start-left", "header-start-left"],
"description": "Headings must start at the beginning of the line", "description": "Headings must start at the beginning of the line",
@ -3465,7 +3465,7 @@ module.exports = {
// @ts-check // @ts-check
const { addError, allPunctuationNoQuestion, escapeForRegExp, forEachHeading } = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"); const { addError, allPunctuationNoQuestion, escapeForRegExp, forEachHeading } = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js");
const endOfLineHtmlEntityRe = /&#?[0-9a-zA-Z]+;$/; const endOfLineHtmlEntityRe = /&#?[\da-zA-Z]+;$/;
module.exports = { module.exports = {
"names": ["MD026", "no-trailing-punctuation"], "names": ["MD026", "no-trailing-punctuation"],
"description": "Trailing punctuation in heading", "description": "Trailing punctuation in heading",
@ -3798,11 +3798,11 @@ module.exports = {
const { addError, forEachLine, htmlElementRe, withinAnyRange, unescapeMarkdown } = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"); const { addError, forEachLine, htmlElementRe, withinAnyRange, unescapeMarkdown } = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js");
const { codeBlockAndSpanRanges, lineMetadata, referenceLinkImageData } = __webpack_require__(/*! ./cache */ "../lib/cache.js"); const { codeBlockAndSpanRanges, lineMetadata, referenceLinkImageData } = __webpack_require__(/*! ./cache */ "../lib/cache.js");
const linkDestinationRe = /]\(\s*$/; const linkDestinationRe = /\]\(\s*$/;
// See https://spec.commonmark.org/0.29/#autolinks // See https://spec.commonmark.org/0.29/#autolinks
const emailAddressRe = const emailAddressRe =
// eslint-disable-next-line max-len // eslint-disable-next-line max-len
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; /^[\w.!#$%&'*+/=?^`{|}~-]+@[a-zA-Z\d](?:[a-zA-Z\d-]{0,61}[a-zA-Z\d])?(?:\.[a-zA-Z\d](?:[a-zA-Z\d-]{0,61}[a-zA-Z\d])?)*$/;
module.exports = { module.exports = {
"names": ["MD033", "no-inline-html"], "names": ["MD033", "no-inline-html"],
"description": "Inline HTML", "description": "Inline HTML",
@ -3858,7 +3858,7 @@ module.exports = {
const { addErrorContext, filterTokens, funcExpExec, urlFe, withinAnyRange } = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"); const { addErrorContext, filterTokens, funcExpExec, urlFe, withinAnyRange } = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js");
const { codeBlockAndSpanRanges, htmlElementRanges, referenceLinkImageData } = __webpack_require__(/*! ./cache */ "../lib/cache.js"); const { codeBlockAndSpanRanges, htmlElementRanges, referenceLinkImageData } = __webpack_require__(/*! ./cache */ "../lib/cache.js");
const htmlLinkRe = /<a(?:|\s[^>]+)>[^<>]*<\/a\s*>/ig; const htmlLinkRe = /<a(?:|\s[^>]+)>[^<>]*<\/a\s*>/gi;
module.exports = { module.exports = {
"names": ["MD034", "no-bare-urls"], "names": ["MD034", "no-bare-urls"],
"description": "Bare URL used", "description": "Bare URL used",
@ -3945,7 +3945,7 @@ module.exports = {
filterTokens(params, "hr", (token) => { filterTokens(params, "hr", (token) => {
const { line, lineNumber } = token; const { line, lineNumber } = token;
let { markup } = token; let { markup } = token;
const match = line.match(/[_*\-\s\t]+$/); const match = line.match(/[_*\-\s]+$/);
if (match) { if (match) {
markup = match[0].trim(); markup = match[0].trim();
} }
@ -4036,8 +4036,8 @@ module.exports = {
const { addErrorContext, emphasisMarkersInContent, forEachLine, isBlankLine, withinAnyRange } = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"); const { addErrorContext, emphasisMarkersInContent, forEachLine, isBlankLine, withinAnyRange } = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js");
const { htmlElementRanges, lineMetadata } = __webpack_require__(/*! ./cache */ "../lib/cache.js"); const { htmlElementRanges, lineMetadata } = __webpack_require__(/*! ./cache */ "../lib/cache.js");
const emphasisRe = /(^|[^\\]|\\\\)(?:(\*\*?\*?)|(__?_?))/g; const emphasisRe = /(^|[^\\]|\\\\)(?:(\*{1,3})|(_{1,3}))/g;
const embeddedUnderscoreRe = /([A-Za-z0-9])_([A-Za-z0-9])/g; const embeddedUnderscoreRe = /([A-Za-z\d])_([A-Za-z\d])/g;
const asteriskListItemMarkerRe = /^([\s>]*)\*(\s+)/; const asteriskListItemMarkerRe = /^([\s>]*)\*(\s+)/;
const leftSpaceRe = /^\s+/; const leftSpaceRe = /^\s+/;
const rightSpaceRe = /\s+$/; const rightSpaceRe = /\s+$/;
@ -4271,7 +4271,7 @@ module.exports = {
// @ts-check // @ts-check
const { addErrorContext, filterTokens } = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js"); const { addErrorContext, filterTokens } = __webpack_require__(/*! ../helpers */ "../helpers/helpers.js");
const spaceInLinkRe = /\[(?:\s+(?:[^\]]*?)\s*|(?:[^\]]*?)\s+)](?=((?:\([^)]*\))|(?:\[[^\]]*\])))/; const spaceInLinkRe = /\[(?:\s[^\]]*|[^\]]*?\s)\](?=(\([^)]*\)|\[[^\]]*\]))/;
module.exports = { module.exports = {
"names": ["MD039", "no-space-in-links"], "names": ["MD039", "no-space-in-links"],
"description": "Spaces inside link text", "description": "Spaces inside link text",

View file

@ -10,16 +10,16 @@ module.exports.newLineRe = newLineRe;
// Regular expression for matching common front matter (YAML and TOML) // Regular expression for matching common front matter (YAML and TOML)
module.exports.frontMatterRe = module.exports.frontMatterRe =
// eslint-disable-next-line max-len // eslint-disable-next-line max-len
/((^---\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 // Regular expression for matching the start of inline disable/enable comments
const inlineCommentStartRe = const inlineCommentStartRe =
// eslint-disable-next-line max-len // eslint-disable-next-line max-len
/(<!--\s*markdownlint-(disable|enable|capture|restore|disable-file|enable-file|disable-line|disable-next-line|configure-file))(?:\s|-->)/ig; /(<!--\s*markdownlint-(disable|enable|capture|restore|disable-file|enable-file|disable-line|disable-next-line|configure-file))(?:\s|-->)/gi;
module.exports.inlineCommentStartRe = inlineCommentStartRe; module.exports.inlineCommentStartRe = inlineCommentStartRe;
// Regular expression for matching HTML elements // Regular expression for matching HTML elements
const htmlElementRe = /<(([A-Za-z][A-Za-z0-9-]*)(?:\s[^`>]*)?)\/?>/g; const htmlElementRe = /<(([A-Za-z][A-Za-z\d-]*)(?:\s[^`>]*)?)\/?>/g;
module.exports.htmlElementRe = htmlElementRe; module.exports.htmlElementRe = htmlElementRe;
// Regular expressions for range matching // Regular expressions for range matching
@ -35,10 +35,10 @@ module.exports.blockquotePrefixRe = blockquotePrefixRe;
// Regular expression for reference links (full, collapsed, and shortcut) // Regular expression for reference links (full, collapsed, and shortcut)
const referenceLinkRe = const referenceLinkRe =
/!?\\?\[((?:\[[^\]\0]*]|[^[\]\0])*)](?:(?:\[([^\]\0]*)\])|([^(])|$)/g; /!?\\?\[((?:\[[^\]\0]*\]|[^[\]\0])*)\](?:\[([^\]\0]*)\]|([^(])|$)/g;
// Regular expression for link reference definitions // Regular expression for link reference definitions
const linkReferenceDefinitionRe = /^ {0,3}\[([^\]]*[^\\])]:/; const linkReferenceDefinitionRe = /^ {0,3}\[([^\]]*[^\\])\]:/;
module.exports.linkReferenceDefinitionRe = linkReferenceDefinitionRe; module.exports.linkReferenceDefinitionRe = linkReferenceDefinitionRe;
// All punctuation characters (normal and full-width) // All punctuation characters (normal and full-width)

View file

@ -6,7 +6,7 @@ const { addError, forEachLine, withinAnyRange } = require("../helpers");
const { codeBlockAndSpanRanges, lineMetadata } = require("./cache"); const { codeBlockAndSpanRanges, lineMetadata } = require("./cache");
const reversedLinkRe = const reversedLinkRe =
/(^|[^\\])\(([^()]+)\)\[([^\]^][^\]]*)](?!\()/g; /(^|[^\\])\(([^()]+)\)\[([^\]^][^\]]*)\](?!\()/g;
module.exports = { module.exports = {
"names": [ "MD011", "no-reversed-links" ], "names": [ "MD011", "no-reversed-links" ],

View file

@ -13,7 +13,7 @@ module.exports = {
filterTokens(params, "heading_open", (token) => { filterTokens(params, "heading_open", (token) => {
if (headingStyleFor(token) === "atx") { if (headingStyleFor(token) === "atx") {
const { line, lineNumber } = token; const { line, lineNumber } = token;
const match = /^(#+)([ \t]{2,})(?:\S)/.exec(line); const match = /^(#+)([ \t]{2,})\S/.exec(line);
if (match) { if (match) {
const [ const [
, ,

View file

@ -4,7 +4,7 @@
const { addErrorContext, filterTokens } = require("../helpers"); const { addErrorContext, filterTokens } = require("../helpers");
const spaceBeforeHeadingRe = /^((?:\s+)|(?:[>\s]+\s\s))[^>\s]/; const spaceBeforeHeadingRe = /^(\s+|[>\s]+\s\s)[^>\s]/;
module.exports = { module.exports = {
"names": [ "MD023", "heading-start-left", "header-start-left" ], "names": [ "MD023", "heading-start-left", "header-start-left" ],

View file

@ -5,7 +5,7 @@
const { addError, allPunctuationNoQuestion, escapeForRegExp, forEachHeading } = const { addError, allPunctuationNoQuestion, escapeForRegExp, forEachHeading } =
require("../helpers"); require("../helpers");
const endOfLineHtmlEntityRe = /&#?[0-9a-zA-Z]+;$/; const endOfLineHtmlEntityRe = /&#?[\da-zA-Z]+;$/;
module.exports = { module.exports = {
"names": [ "MD026", "no-trailing-punctuation" ], "names": [ "MD026", "no-trailing-punctuation" ],

View file

@ -8,11 +8,11 @@ const {
const { codeBlockAndSpanRanges, lineMetadata, referenceLinkImageData } = const { codeBlockAndSpanRanges, lineMetadata, referenceLinkImageData } =
require("./cache"); require("./cache");
const linkDestinationRe = /]\(\s*$/; const linkDestinationRe = /\]\(\s*$/;
// See https://spec.commonmark.org/0.29/#autolinks // See https://spec.commonmark.org/0.29/#autolinks
const emailAddressRe = const emailAddressRe =
// eslint-disable-next-line max-len // eslint-disable-next-line max-len
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; /^[\w.!#$%&'*+/=?^`{|}~-]+@[a-zA-Z\d](?:[a-zA-Z\d-]{0,61}[a-zA-Z\d])?(?:\.[a-zA-Z\d](?:[a-zA-Z\d-]{0,61}[a-zA-Z\d])?)*$/;
module.exports = { module.exports = {
"names": [ "MD033", "no-inline-html" ], "names": [ "MD033", "no-inline-html" ],

View file

@ -7,7 +7,7 @@ const { addErrorContext, filterTokens, funcExpExec, urlFe, withinAnyRange } =
const { codeBlockAndSpanRanges, htmlElementRanges, referenceLinkImageData } = const { codeBlockAndSpanRanges, htmlElementRanges, referenceLinkImageData } =
require("./cache"); require("./cache");
const htmlLinkRe = /<a(?:|\s[^>]+)>[^<>]*<\/a\s*>/ig; const htmlLinkRe = /<a(?:|\s[^>]+)>[^<>]*<\/a\s*>/gi;
module.exports = { module.exports = {
"names": [ "MD034", "no-bare-urls" ], "names": [ "MD034", "no-bare-urls" ],

View file

@ -13,7 +13,7 @@ module.exports = {
filterTokens(params, "hr", (token) => { filterTokens(params, "hr", (token) => {
const { line, lineNumber } = token; const { line, lineNumber } = token;
let { markup } = token; let { markup } = token;
const match = line.match(/[_*\-\s\t]+$/); const match = line.match(/[_*\-\s]+$/);
if (match) { if (match) {
markup = match[0].trim(); markup = match[0].trim();
} }

View file

@ -6,8 +6,8 @@ const { addErrorContext, emphasisMarkersInContent, forEachLine, isBlankLine,
withinAnyRange } = require("../helpers"); withinAnyRange } = require("../helpers");
const { htmlElementRanges, lineMetadata } = require("./cache"); const { htmlElementRanges, lineMetadata } = require("./cache");
const emphasisRe = /(^|[^\\]|\\\\)(?:(\*\*?\*?)|(__?_?))/g; const emphasisRe = /(^|[^\\]|\\\\)(?:(\*{1,3})|(_{1,3}))/g;
const embeddedUnderscoreRe = /([A-Za-z0-9])_([A-Za-z0-9])/g; const embeddedUnderscoreRe = /([A-Za-z\d])_([A-Za-z\d])/g;
const asteriskListItemMarkerRe = /^([\s>]*)\*(\s+)/; const asteriskListItemMarkerRe = /^([\s>]*)\*(\s+)/;
const leftSpaceRe = /^\s+/; const leftSpaceRe = /^\s+/;
const rightSpaceRe = /\s+$/; const rightSpaceRe = /\s+$/;

View file

@ -5,7 +5,7 @@
const { addErrorContext, filterTokens } = require("../helpers"); const { addErrorContext, filterTokens } = require("../helpers");
const spaceInLinkRe = const spaceInLinkRe =
/\[(?:\s+(?:[^\]]*?)\s*|(?:[^\]]*?)\s+)](?=((?:\([^)]*\))|(?:\[[^\]]*\])))/; /\[(?:\s[^\]]*|[^\]]*?\s)\](?=(\([^)]*\)|\[[^\]]*\]))/;
module.exports = { module.exports = {
"names": [ "MD039", "no-space-in-links" ], "names": [ "MD039", "no-space-in-links" ],

View file

@ -70,6 +70,7 @@
"eslint-plugin-es": "4.1.0", "eslint-plugin-es": "4.1.0",
"eslint-plugin-jsdoc": "39.6.4", "eslint-plugin-jsdoc": "39.6.4",
"eslint-plugin-n": "15.6.0", "eslint-plugin-n": "15.6.0",
"eslint-plugin-regexp": "1.11.0",
"eslint-plugin-unicorn": "45.0.2", "eslint-plugin-unicorn": "45.0.2",
"globby": "13.1.3", "globby": "13.1.3",
"js-yaml": "4.1.0", "js-yaml": "4.1.0",

View file

@ -568,7 +568,7 @@ test("customFrontMatter", (t) => new Promise((resolve) => {
"strings": { "strings": {
"content": "<head>\n\t\n</head>\n# Heading\n" "content": "<head>\n\t\n</head>\n# Heading\n"
}, },
"frontMatter": /<head>[^]*<\/head>/, "frontMatter": /<head>[\s\S]*<\/head>/,
"config": { "config": {
"default": false, "default": false,
"MD010": true "MD010": true

View file

@ -17,7 +17,7 @@ const languageJavaScript = /js|javascript/i;
function cleanJsdocRulesFromEslintConfig(config) { function cleanJsdocRulesFromEslintConfig(config) {
const cleanedConfig = { ...config }; const cleanedConfig = { ...config };
for (const rule in config.rules) { for (const rule in config.rules) {
if (/^(es|jsdoc|n|unicorn)\//.test(rule)) { if (/^(es|jsdoc|n|regexp|unicorn)\//.test(rule)) {
delete cleanedConfig.rules[rule]; delete cleanedConfig.rules[rule];
} }
} }