Remove deprecated ESLint rules after version update.

This commit is contained in:
David Anson 2023-11-05 20:13:12 -08:00
parent 760055e129
commit 3b1dfe42df
10 changed files with 8 additions and 57 deletions

View file

@ -75,19 +75,10 @@
],
"reportUnusedDisableDirectives": true,
"rules": {
"array-bracket-spacing": ["error", "always"],
"array-element-newline": "off",
"capitalized-comments": "off",
"complexity": "off",
"dot-location": ["error", "property"],
"func-style": "off",
"function-call-argument-newline": "off",
"function-paren-newline": "off",
"global-require": "off",
"id-length": "off",
"indent": ["error", 2, { "SwitchCase": 1 }],
"linebreak-style": "off",
"lines-around-comment": "off",
"logical-assignment-operators": "off",
"max-depth": "off",
"max-lines": "off",
@ -95,24 +86,17 @@
"max-params": ["off"],
"max-statements": "off",
"multiline-comment-style": ["error", "separate-lines"],
"multiline-ternary": "off",
"newline-per-chained-call": "off",
"no-continue": "off",
"no-empty-function": "off",
"no-extra-parens": "off",
"no-implicit-coercion": "off",
"no-magic-numbers": "off",
"no-nested-ternary": "off",
"no-param-reassign": "off",
"no-plusplus": "off",
"no-sync": "off",
"no-ternary": "off",
"no-undefined": "off",
"object-curly-spacing": ["error", "always"],
"object-shorthand": "off",
"one-var": "off",
"operator-linebreak": ["error", "after"],
"padded-blocks": "off",
"prefer-arrow-callback": "off",
"prefer-destructuring": "off",
"prefer-named-capture-group": "off",
@ -120,9 +104,7 @@
"require-unicode-regexp": "off",
"sort-imports": "off",
"sort-keys": "off",
"space-before-function-paren": ["error", "never"],
"vars-on-top": "off",
"wrap-regex": "off",
"es/no-regexp-lookbehind-assertions": "error",

View file

@ -215,7 +215,6 @@
violations.addEventListener("click", onViolationClick, true);
copyLink.addEventListener("click", onCopyLinkClick);
/* eslint-disable max-len */
markdown.value = [
"## Introduction",
"",
@ -243,7 +242,6 @@
"[`markdownlint/Ruby`](https://github.com/markdownlint/markdownlint) for the inspiration and [`markdown-it`](https://github.com/markdown-it/markdown-it) for the parser and interactive demo idea!",
""
].join("\n");
/* eslint-enable max-len */
// Update Markdown from hash (if present)
if (window.location.hash) {

File diff suppressed because one or more lines are too long

View file

@ -11,12 +11,10 @@ module.exports.nextLinesRe = nextLinesRe;
// 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;
// Regular expression for matching the start of inline disable/enable comments
const inlineCommentStartRe =
// eslint-disable-next-line max-len
/(<!--\s*markdownlint-(disable|enable|capture|restore|disable-file|enable-file|disable-line|disable-next-line|configure-file))(?:\s|-->)/gi;
module.exports.inlineCommentStartRe = inlineCommentStartRe;
@ -34,12 +32,10 @@ module.exports.linkReferenceDefinitionRe = linkReferenceDefinitionRe;
// Regular expression for identifying an HTML entity at the end of a line
module.exports.endOfLineHtmlEntityRe =
// eslint-disable-next-line max-len
/&(?:#\d+|#[xX][\da-fA-F]+|[a-zA-Z]{2,31}|blk\d{2}|emsp1[34]|frac\d{2}|sup\d|there4);$/;
// Regular expression for identifying a GitHub emoji code at the end of a line
module.exports.endOfLineGemojiCodeRe =
// eslint-disable-next-line max-len
/:(?:[abmovx]|[-+]1|100|1234|(?:1st|2nd|3rd)_place_medal|8ball|clock\d{1,4}|e-mail|non-potable_water|o2|t-rex|u5272|u5408|u55b6|u6307|u6708|u6709|u6e80|u7121|u7533|u7981|u7a7a|[a-z]{2,15}2?|[a-z]{1,14}(?:_[a-z\d]{1,16})+):$/;
// All punctuation characters (normal and full-width)

View file

@ -12,7 +12,7 @@ const helpers = require("../helpers");
const cache = require("./cache");
// @ts-ignore
// eslint-disable-next-line camelcase, max-len, no-inline-comments, no-undef
// eslint-disable-next-line camelcase, no-inline-comments, no-undef
const dynamicRequire = (typeof __non_webpack_require__ === "undefined") ? require : /* c8 ignore next */ __non_webpack_require__;
// Capture native require implementation for dynamic loading of modules
@ -604,7 +604,6 @@ function lintContent(
// eslint-disable-next-line jsdoc/require-jsdoc
function throwError(property) {
throw new Error(
// eslint-disable-next-line max-len
`Value of '${property}' passed to onError by '${ruleName}' is incorrect for '${name}'.`);
}
// eslint-disable-next-line jsdoc/require-jsdoc

View file

@ -42,7 +42,6 @@ function convertHeadingToHTMLFragment(headingText) {
inlineText
.toLowerCase()
// RegExp source with Ruby's \p{Word} expanded into its General Categories
// eslint-disable-next-line max-len
// https://github.com/gjtorikian/html-pipeline/blob/main/lib/html/pipeline/toc_filter.rb
// https://ruby-doc.org/core-3.0.2/Regexp.html
.replace(

View file

@ -1,6 +1,6 @@
// @ts-check
/* eslint-disable max-len, n/no-missing-import */
/* eslint-disable n/no-missing-import */
export { compile } from "micromark";
export { gfmAutolinkLiteralHtml } from "micromark-extension-gfm-autolink-literal";

View file

@ -28,12 +28,9 @@ for (const rule in configSchema.properties) {
const transformComments = (input, commentPrefix) => (
commentPrefix +
// eslint-disable-next-line max-len
" Example markdownlint configuration with all properties set to their default value\n" +
input
// eslint-disable-next-line max-len
.replace(/^(\s*)[^-\s]+-sub-description"?: "?([^"\n]+)"?,?$/gm, "$1" + commentPrefix + " $2")
// eslint-disable-next-line max-len
.replace(/^(\s*)[^-\s]+-description"?: "?([^"\n]+)"?,?$/gm, "\n$1" + commentPrefix + " $2")
);

View file

@ -251,7 +251,6 @@ test("configBadHybrid", (t) => new Promise((resolve) => {
t.truthy(err, "Did not get an error for bad child JSON.");
t.true(err instanceof Error, "Error not instance of Error.");
t.truthy(err.message.match(
// eslint-disable-next-line max-len
/^Unable to parse '[^']*'; Parser \d+: (Unexpected token|Expected property name)/
), "Error message unexpected.");
t.true(!result, "Got result for bad child JSON.");
@ -332,7 +331,6 @@ test("configBadJsonSync", (t) => {
},
{
"message":
// eslint-disable-next-line max-len
/Unable to parse '[^']*'; Parser \d+: (Unexpected token|Expected property name)/
},
"Did not get correct exception for bad JSON."
@ -347,7 +345,6 @@ test("configBadChildJsonSync", (t) => {
},
{
"message":
// eslint-disable-next-line max-len
/Unable to parse '[^']*'; Parser \d+: (Unexpected token|Expected property name)/
},
"Did not get correct exception for bad child JSON."
@ -441,7 +438,6 @@ test("configBadHybridSync", (t) => {
[ JSON.parse, require("toml").parse, require("js-yaml").load ]);
},
{
// eslint-disable-next-line max-len
"message": /^Unable to parse '[^']*'; Parser \d+: (Unexpected token|Expected property name)/
},
"Did not get correct exception for bad content."

View file

@ -656,7 +656,6 @@ test("customRulesOnErrorNull", (t) => new Promise((resolve) => {
t.is(
// @ts-ignore
err.message,
// eslint-disable-next-line max-len
"Value of 'lineNumber' passed to onError by 'NAME' is incorrect for 'string'.",
"Did not get correct exception for null object."
);
@ -687,7 +686,6 @@ test("customRulesOnErrorNullSync", (t) => {
markdownlint.sync(options);
},
{
// eslint-disable-next-line max-len
"message": "Value of 'lineNumber' passed to onError by 'NAME' is incorrect for 'string'."
},
"Did not get correct exception for null object."
@ -777,7 +775,6 @@ test("customRulesOnErrorBad", (t) => {
},
{
"message":
// eslint-disable-next-line max-len
`Value of '${propertyNames}' passed to onError by 'NAME' is incorrect for 'string'.`
},
"Did not get correct exception for bad object."
@ -848,7 +845,6 @@ test("customRulesOnErrorInvalid", (t) => {
},
{
"message":
// eslint-disable-next-line max-len
`Value of '${propertyNames}' passed to onError by 'NAME' is incorrect for 'string'.`
},
"Did not get correct exception for invalid object."
@ -1056,7 +1052,6 @@ test("customRulesOnErrorInvalidHandled", (t) => new Promise((resolve) => {
"ruleDescription": "description",
"ruleInformation": null,
"errorDetail": "This rule threw an exception: " +
// eslint-disable-next-line max-len
"Value of 'lineNumber' passed to onError by 'NAME' is incorrect for 'string'.",
"errorContext": null,
"errorRange": null,
@ -1098,7 +1093,6 @@ test("customRulesOnErrorInvalidHandledSync", (t) => {
"ruleDescription": "description",
"ruleInformation": null,
"errorDetail": "This rule threw an exception: " +
// eslint-disable-next-line max-len
"Value of 'lineNumber' passed to onError by 'NAME' is incorrect for 'string'.",
"errorContext": null,
"errorRange": null,