mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Remove deprecated ESLint rules after version update.
This commit is contained in:
parent
760055e129
commit
3b1dfe42df
10 changed files with 8 additions and 57 deletions
|
|
@ -75,19 +75,10 @@
|
||||||
],
|
],
|
||||||
"reportUnusedDisableDirectives": true,
|
"reportUnusedDisableDirectives": true,
|
||||||
"rules": {
|
"rules": {
|
||||||
"array-bracket-spacing": ["error", "always"],
|
|
||||||
"array-element-newline": "off",
|
|
||||||
"capitalized-comments": "off",
|
"capitalized-comments": "off",
|
||||||
"complexity": "off",
|
"complexity": "off",
|
||||||
"dot-location": ["error", "property"],
|
|
||||||
"func-style": "off",
|
"func-style": "off",
|
||||||
"function-call-argument-newline": "off",
|
|
||||||
"function-paren-newline": "off",
|
|
||||||
"global-require": "off",
|
|
||||||
"id-length": "off",
|
"id-length": "off",
|
||||||
"indent": ["error", 2, { "SwitchCase": 1 }],
|
|
||||||
"linebreak-style": "off",
|
|
||||||
"lines-around-comment": "off",
|
|
||||||
"logical-assignment-operators": "off",
|
"logical-assignment-operators": "off",
|
||||||
"max-depth": "off",
|
"max-depth": "off",
|
||||||
"max-lines": "off",
|
"max-lines": "off",
|
||||||
|
|
@ -95,24 +86,17 @@
|
||||||
"max-params": ["off"],
|
"max-params": ["off"],
|
||||||
"max-statements": "off",
|
"max-statements": "off",
|
||||||
"multiline-comment-style": ["error", "separate-lines"],
|
"multiline-comment-style": ["error", "separate-lines"],
|
||||||
"multiline-ternary": "off",
|
|
||||||
"newline-per-chained-call": "off",
|
|
||||||
"no-continue": "off",
|
"no-continue": "off",
|
||||||
"no-empty-function": "off",
|
"no-empty-function": "off",
|
||||||
"no-extra-parens": "off",
|
"no-extra-parens": "off",
|
||||||
"no-implicit-coercion": "off",
|
"no-implicit-coercion": "off",
|
||||||
"no-magic-numbers": "off",
|
"no-magic-numbers": "off",
|
||||||
"no-nested-ternary": "off",
|
|
||||||
"no-param-reassign": "off",
|
"no-param-reassign": "off",
|
||||||
"no-plusplus": "off",
|
"no-plusplus": "off",
|
||||||
"no-sync": "off",
|
|
||||||
"no-ternary": "off",
|
"no-ternary": "off",
|
||||||
"no-undefined": "off",
|
"no-undefined": "off",
|
||||||
"object-curly-spacing": ["error", "always"],
|
|
||||||
"object-shorthand": "off",
|
"object-shorthand": "off",
|
||||||
"one-var": "off",
|
"one-var": "off",
|
||||||
"operator-linebreak": ["error", "after"],
|
|
||||||
"padded-blocks": "off",
|
|
||||||
"prefer-arrow-callback": "off",
|
"prefer-arrow-callback": "off",
|
||||||
"prefer-destructuring": "off",
|
"prefer-destructuring": "off",
|
||||||
"prefer-named-capture-group": "off",
|
"prefer-named-capture-group": "off",
|
||||||
|
|
@ -120,9 +104,7 @@
|
||||||
"require-unicode-regexp": "off",
|
"require-unicode-regexp": "off",
|
||||||
"sort-imports": "off",
|
"sort-imports": "off",
|
||||||
"sort-keys": "off",
|
"sort-keys": "off",
|
||||||
"space-before-function-paren": ["error", "never"],
|
|
||||||
"vars-on-top": "off",
|
"vars-on-top": "off",
|
||||||
"wrap-regex": "off",
|
|
||||||
|
|
||||||
"es/no-regexp-lookbehind-assertions": "error",
|
"es/no-regexp-lookbehind-assertions": "error",
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -215,7 +215,6 @@
|
||||||
violations.addEventListener("click", onViolationClick, true);
|
violations.addEventListener("click", onViolationClick, true);
|
||||||
copyLink.addEventListener("click", onCopyLinkClick);
|
copyLink.addEventListener("click", onCopyLinkClick);
|
||||||
|
|
||||||
/* eslint-disable max-len */
|
|
||||||
markdown.value = [
|
markdown.value = [
|
||||||
"## Introduction",
|
"## 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!",
|
"[`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");
|
].join("\n");
|
||||||
/* eslint-enable max-len */
|
|
||||||
|
|
||||||
// Update Markdown from hash (if present)
|
// Update Markdown from hash (if present)
|
||||||
if (window.location.hash) {
|
if (window.location.hash) {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -11,12 +11,10 @@ module.exports.nextLinesRe = nextLinesRe;
|
||||||
|
|
||||||
// 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
|
|
||||||
/((^---\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
|
// Regular expression for matching the start of inline disable/enable comments
|
||||||
const inlineCommentStartRe =
|
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;
|
/(<!--\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;
|
||||||
|
|
||||||
|
|
@ -34,12 +32,10 @@ module.exports.linkReferenceDefinitionRe = linkReferenceDefinitionRe;
|
||||||
|
|
||||||
// Regular expression for identifying an HTML entity at the end of a line
|
// Regular expression for identifying an HTML entity at the end of a line
|
||||||
module.exports.endOfLineHtmlEntityRe =
|
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);$/;
|
/&(?:#\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
|
// Regular expression for identifying a GitHub emoji code at the end of a line
|
||||||
module.exports.endOfLineGemojiCodeRe =
|
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})+):$/;
|
/:(?:[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)
|
// All punctuation characters (normal and full-width)
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ const helpers = require("../helpers");
|
||||||
const cache = require("./cache");
|
const cache = require("./cache");
|
||||||
|
|
||||||
// @ts-ignore
|
// @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__;
|
const dynamicRequire = (typeof __non_webpack_require__ === "undefined") ? require : /* c8 ignore next */ __non_webpack_require__;
|
||||||
// Capture native require implementation for dynamic loading of modules
|
// Capture native require implementation for dynamic loading of modules
|
||||||
|
|
||||||
|
|
@ -604,7 +604,6 @@ function lintContent(
|
||||||
// eslint-disable-next-line jsdoc/require-jsdoc
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
||||||
function throwError(property) {
|
function throwError(property) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
`Value of '${property}' passed to onError by '${ruleName}' is incorrect for '${name}'.`);
|
`Value of '${property}' passed to onError by '${ruleName}' is incorrect for '${name}'.`);
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line jsdoc/require-jsdoc
|
// eslint-disable-next-line jsdoc/require-jsdoc
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ function convertHeadingToHTMLFragment(headingText) {
|
||||||
inlineText
|
inlineText
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
// RegExp source with Ruby's \p{Word} expanded into its General Categories
|
// 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://github.com/gjtorikian/html-pipeline/blob/main/lib/html/pipeline/toc_filter.rb
|
||||||
// https://ruby-doc.org/core-3.0.2/Regexp.html
|
// https://ruby-doc.org/core-3.0.2/Regexp.html
|
||||||
.replace(
|
.replace(
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// @ts-check
|
// @ts-check
|
||||||
|
|
||||||
/* eslint-disable max-len, n/no-missing-import */
|
/* eslint-disable n/no-missing-import */
|
||||||
|
|
||||||
export { compile } from "micromark";
|
export { compile } from "micromark";
|
||||||
export { gfmAutolinkLiteralHtml } from "micromark-extension-gfm-autolink-literal";
|
export { gfmAutolinkLiteralHtml } from "micromark-extension-gfm-autolink-literal";
|
||||||
|
|
|
||||||
|
|
@ -28,12 +28,9 @@ for (const rule in configSchema.properties) {
|
||||||
|
|
||||||
const transformComments = (input, commentPrefix) => (
|
const transformComments = (input, commentPrefix) => (
|
||||||
commentPrefix +
|
commentPrefix +
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
" Example markdownlint configuration with all properties set to their default value\n" +
|
" Example markdownlint configuration with all properties set to their default value\n" +
|
||||||
input
|
input
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
.replace(/^(\s*)[^-\s]+-sub-description"?: "?([^"\n]+)"?,?$/gm, "$1" + commentPrefix + " $2")
|
.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")
|
.replace(/^(\s*)[^-\s]+-description"?: "?([^"\n]+)"?,?$/gm, "\n$1" + commentPrefix + " $2")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -251,7 +251,6 @@ test("configBadHybrid", (t) => new Promise((resolve) => {
|
||||||
t.truthy(err, "Did not get an error for bad child JSON.");
|
t.truthy(err, "Did not get an error for bad child JSON.");
|
||||||
t.true(err instanceof Error, "Error not instance of Error.");
|
t.true(err instanceof Error, "Error not instance of Error.");
|
||||||
t.truthy(err.message.match(
|
t.truthy(err.message.match(
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
/^Unable to parse '[^']*'; Parser \d+: (Unexpected token|Expected property name)/
|
/^Unable to parse '[^']*'; Parser \d+: (Unexpected token|Expected property name)/
|
||||||
), "Error message unexpected.");
|
), "Error message unexpected.");
|
||||||
t.true(!result, "Got result for bad child JSON.");
|
t.true(!result, "Got result for bad child JSON.");
|
||||||
|
|
@ -332,7 +331,6 @@ test("configBadJsonSync", (t) => {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"message":
|
"message":
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
/Unable to parse '[^']*'; Parser \d+: (Unexpected token|Expected property name)/
|
/Unable to parse '[^']*'; Parser \d+: (Unexpected token|Expected property name)/
|
||||||
},
|
},
|
||||||
"Did not get correct exception for bad JSON."
|
"Did not get correct exception for bad JSON."
|
||||||
|
|
@ -347,7 +345,6 @@ test("configBadChildJsonSync", (t) => {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"message":
|
"message":
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
/Unable to parse '[^']*'; Parser \d+: (Unexpected token|Expected property name)/
|
/Unable to parse '[^']*'; Parser \d+: (Unexpected token|Expected property name)/
|
||||||
},
|
},
|
||||||
"Did not get correct exception for bad child JSON."
|
"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 ]);
|
[ 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)/
|
"message": /^Unable to parse '[^']*'; Parser \d+: (Unexpected token|Expected property name)/
|
||||||
},
|
},
|
||||||
"Did not get correct exception for bad content."
|
"Did not get correct exception for bad content."
|
||||||
|
|
|
||||||
|
|
@ -656,7 +656,6 @@ test("customRulesOnErrorNull", (t) => new Promise((resolve) => {
|
||||||
t.is(
|
t.is(
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
err.message,
|
err.message,
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
"Value of 'lineNumber' passed to onError by 'NAME' is incorrect for 'string'.",
|
"Value of 'lineNumber' passed to onError by 'NAME' is incorrect for 'string'.",
|
||||||
"Did not get correct exception for null object."
|
"Did not get correct exception for null object."
|
||||||
);
|
);
|
||||||
|
|
@ -687,7 +686,6 @@ test("customRulesOnErrorNullSync", (t) => {
|
||||||
markdownlint.sync(options);
|
markdownlint.sync(options);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
"message": "Value of 'lineNumber' passed to onError by 'NAME' is incorrect for 'string'."
|
"message": "Value of 'lineNumber' passed to onError by 'NAME' is incorrect for 'string'."
|
||||||
},
|
},
|
||||||
"Did not get correct exception for null object."
|
"Did not get correct exception for null object."
|
||||||
|
|
@ -777,7 +775,6 @@ test("customRulesOnErrorBad", (t) => {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"message":
|
"message":
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
`Value of '${propertyNames}' passed to onError by 'NAME' is incorrect for 'string'.`
|
`Value of '${propertyNames}' passed to onError by 'NAME' is incorrect for 'string'.`
|
||||||
},
|
},
|
||||||
"Did not get correct exception for bad object."
|
"Did not get correct exception for bad object."
|
||||||
|
|
@ -848,7 +845,6 @@ test("customRulesOnErrorInvalid", (t) => {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"message":
|
"message":
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
`Value of '${propertyNames}' passed to onError by 'NAME' is incorrect for 'string'.`
|
`Value of '${propertyNames}' passed to onError by 'NAME' is incorrect for 'string'.`
|
||||||
},
|
},
|
||||||
"Did not get correct exception for invalid object."
|
"Did not get correct exception for invalid object."
|
||||||
|
|
@ -1056,7 +1052,6 @@ test("customRulesOnErrorInvalidHandled", (t) => new Promise((resolve) => {
|
||||||
"ruleDescription": "description",
|
"ruleDescription": "description",
|
||||||
"ruleInformation": null,
|
"ruleInformation": null,
|
||||||
"errorDetail": "This rule threw an exception: " +
|
"errorDetail": "This rule threw an exception: " +
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
"Value of 'lineNumber' passed to onError by 'NAME' is incorrect for 'string'.",
|
"Value of 'lineNumber' passed to onError by 'NAME' is incorrect for 'string'.",
|
||||||
"errorContext": null,
|
"errorContext": null,
|
||||||
"errorRange": null,
|
"errorRange": null,
|
||||||
|
|
@ -1098,7 +1093,6 @@ test("customRulesOnErrorInvalidHandledSync", (t) => {
|
||||||
"ruleDescription": "description",
|
"ruleDescription": "description",
|
||||||
"ruleInformation": null,
|
"ruleInformation": null,
|
||||||
"errorDetail": "This rule threw an exception: " +
|
"errorDetail": "This rule threw an exception: " +
|
||||||
// eslint-disable-next-line max-len
|
|
||||||
"Value of 'lineNumber' passed to onError by 'NAME' is incorrect for 'string'.",
|
"Value of 'lineNumber' passed to onError by 'NAME' is incorrect for 'string'.",
|
||||||
"errorContext": null,
|
"errorContext": null,
|
||||||
"errorRange": null,
|
"errorRange": null,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue