Remove rule aliases for "header" (deprecated in v0.9.0).

This commit is contained in:
David Anson 2023-11-09 20:05:30 -08:00
parent 20a552b4b7
commit a9a77940c5
45 changed files with 138 additions and 600 deletions

127
lib/configuration.d.ts vendored
View file

@ -19,19 +19,15 @@ export interface Configuration {
*/
$schema?: string;
/**
* MD001/heading-increment/header-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md001.md
* MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md001.md
*/
MD001?: boolean;
/**
* MD001/heading-increment/header-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md001.md
* MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md001.md
*/
"heading-increment"?: boolean;
/**
* MD001/heading-increment/header-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md001.md
*/
"header-increment"?: boolean;
/**
* MD003/heading-style/header-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md003.md
* MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md003.md
*/
MD003?:
| boolean
@ -42,7 +38,7 @@ export interface Configuration {
style?: "consistent" | "atx" | "atx_closed" | "setext" | "setext_with_atx" | "setext_with_atx_closed";
};
/**
* MD003/heading-style/header-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md003.md
* MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md003.md
*/
"heading-style"?:
| boolean
@ -52,17 +48,6 @@ export interface Configuration {
*/
style?: "consistent" | "atx" | "atx_closed" | "setext" | "setext_with_atx" | "setext_with_atx_closed";
};
/**
* MD003/heading-style/header-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md003.md
*/
"header-style"?:
| boolean
| {
/**
* Heading style
*/
style?: "consistent" | "atx" | "atx_closed" | "setext" | "setext_with_atx" | "setext_with_atx_closed";
};
/**
* MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md004.md
*/
@ -267,10 +252,6 @@ export interface Configuration {
* Include headings
*/
headings?: boolean;
/**
* Include headings
*/
headers?: boolean;
/**
* Strict length checking
*/
@ -310,10 +291,6 @@ export interface Configuration {
* Include headings
*/
headings?: boolean;
/**
* Include headings
*/
headers?: boolean;
/**
* Strict length checking
*/
@ -364,7 +341,7 @@ export interface Configuration {
*/
"no-multiple-space-closed-atx"?: boolean;
/**
* MD022/blanks-around-headings/blanks-around-headers : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md022.md
* MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md022.md
*/
MD022?:
| boolean
@ -379,7 +356,7 @@ export interface Configuration {
lines_below?: number | number[];
};
/**
* MD022/blanks-around-headings/blanks-around-headers : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md022.md
* MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md022.md
*/
"blanks-around-headings"?:
| boolean
@ -394,34 +371,15 @@ export interface Configuration {
lines_below?: number | number[];
};
/**
* MD022/blanks-around-headings/blanks-around-headers : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md022.md
*/
"blanks-around-headers"?:
| boolean
| {
/**
* Blank lines above heading
*/
lines_above?: number | number[];
/**
* Blank lines below heading
*/
lines_below?: number | number[];
};
/**
* MD023/heading-start-left/header-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md023.md
* MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md023.md
*/
MD023?: boolean;
/**
* MD023/heading-start-left/header-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md023.md
* MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md023.md
*/
"heading-start-left"?: boolean;
/**
* MD023/heading-start-left/header-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md023.md
*/
"header-start-left"?: boolean;
/**
* MD024/no-duplicate-heading/no-duplicate-header : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md024.md
* MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md024.md
*/
MD024?:
| boolean
@ -436,7 +394,7 @@ export interface Configuration {
siblings_only?: boolean;
};
/**
* MD024/no-duplicate-heading/no-duplicate-header : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md024.md
* MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md024.md
*/
"no-duplicate-heading"?:
| boolean
@ -450,21 +408,6 @@ export interface Configuration {
*/
siblings_only?: boolean;
};
/**
* MD024/no-duplicate-heading/no-duplicate-header : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md024.md
*/
"no-duplicate-header"?:
| boolean
| {
/**
* Only check sibling headings
*/
allow_different_nesting?: boolean;
/**
* Only check sibling headings
*/
siblings_only?: boolean;
};
/**
* MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md025.md
*/
@ -699,7 +642,7 @@ export interface Configuration {
style?: string;
};
/**
* MD036/no-emphasis-as-heading/no-emphasis-as-header : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md036.md
* MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md036.md
*/
MD036?:
| boolean
@ -710,7 +653,7 @@ export interface Configuration {
punctuation?: string;
};
/**
* MD036/no-emphasis-as-heading/no-emphasis-as-header : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md036.md
* MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md036.md
*/
"no-emphasis-as-heading"?:
| boolean
@ -720,17 +663,6 @@ export interface Configuration {
*/
punctuation?: string;
};
/**
* MD036/no-emphasis-as-heading/no-emphasis-as-header : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md036.md
*/
"no-emphasis-as-header"?:
| boolean
| {
/**
* Punctuation characters
*/
punctuation?: string;
};
/**
* MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md037.md
*/
@ -839,7 +771,7 @@ export interface Configuration {
*/
"no-empty-links"?: boolean;
/**
* MD043/required-headings/required-headers : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md043.md
* MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md043.md
*/
MD043?:
| boolean
@ -848,17 +780,13 @@ export interface Configuration {
* List of headings
*/
headings?: string[];
/**
* List of headings
*/
headers?: string[];
/**
* Match case of headings
*/
match_case?: boolean;
};
/**
* MD043/required-headings/required-headers : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md043.md
* MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md043.md
*/
"required-headings"?:
| boolean
@ -867,29 +795,6 @@ export interface Configuration {
* List of headings
*/
headings?: string[];
/**
* List of headings
*/
headers?: string[];
/**
* Match case of headings
*/
match_case?: boolean;
};
/**
* MD043/required-headings/required-headers : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.31.1/doc/md043.md
*/
"required-headers"?:
| boolean
| {
/**
* List of headings
*/
headings?: string[];
/**
* List of headings
*/
headers?: string[];
/**
* Match case of headings
*/
@ -1131,10 +1036,6 @@ export interface Configuration {
* headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043
*/
headings?: boolean;
/**
* headers : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043
*/
headers?: boolean;
/**
* bullet : MD004, MD005, MD007, MD032
*/

View file

@ -5,9 +5,9 @@
const { addErrorDetailIf, filterTokens } = require("../helpers");
module.exports = {
"names": [ "MD001", "heading-increment", "header-increment" ],
"names": [ "MD001", "heading-increment" ],
"description": "Heading levels should only increment by one level at a time",
"tags": [ "headings", "headers" ],
"tags": [ "headings" ],
"function": function MD001(params, onError) {
let prevLevel = 0;
filterTokens(params, "heading_open", function forToken(token) {

View file

@ -6,9 +6,9 @@ const { addErrorDetailIf, filterTokens, headingStyleFor } =
require("../helpers");
module.exports = {
"names": [ "MD003", "heading-style", "header-style" ],
"names": [ "MD003", "heading-style" ],
"description": "Heading style",
"tags": [ "headings", "headers" ],
"tags": [ "headings" ],
"function": function MD003(params, onError) {
let style = String(params.config.style || "consistent");
filterTokens(params, "heading_open", function forToken(token) {

View file

@ -46,10 +46,7 @@ module.exports = {
const includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks;
const tables = params.config.tables;
const includeTables = (tables === undefined) ? true : !!tables;
let headings = params.config.headings;
if (headings === undefined) {
headings = params.config.headers;
}
const headings = params.config.headings;
const includeHeadings = (headings === undefined) ? true : !!headings;
const headingLineNumbers = [];
forEachHeading(params, (heading) => {

View file

@ -8,7 +8,7 @@ const { lineMetadata } = require("./cache");
module.exports = {
"names": [ "MD018", "no-missing-space-atx" ],
"description": "No space after hash on atx style heading",
"tags": [ "headings", "headers", "atx", "spaces" ],
"tags": [ "headings", "atx", "spaces" ],
"function": function MD018(params, onError) {
forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
if (!inCode &&

View file

@ -8,7 +8,7 @@ const { addErrorContext, filterTokens, headingStyleFor } =
module.exports = {
"names": [ "MD019", "no-multiple-space-atx" ],
"description": "Multiple spaces after hash on atx style heading",
"tags": [ "headings", "headers", "atx", "spaces" ],
"tags": [ "headings", "atx", "spaces" ],
"function": function MD019(params, onError) {
filterTokens(params, "heading_open", (token) => {
if (headingStyleFor(token) === "atx") {

View file

@ -8,7 +8,7 @@ const { lineMetadata } = require("./cache");
module.exports = {
"names": [ "MD020", "no-missing-space-closed-atx" ],
"description": "No space inside hashes on closed atx style heading",
"tags": [ "headings", "headers", "atx_closed", "spaces" ],
"tags": [ "headings", "atx_closed", "spaces" ],
"function": function MD020(params, onError) {
forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
if (!inCode) {

View file

@ -10,7 +10,7 @@ const closedAtxRe = /^(#+)([ \t]+)([^ \t]|[^ \t].*[^ \t])([ \t]+)(#+)(\s*)$/;
module.exports = {
"names": [ "MD021", "no-multiple-space-closed-atx" ],
"description": "Multiple spaces inside hashes on closed atx style heading",
"tags": [ "headings", "headers", "atx_closed", "spaces" ],
"tags": [ "headings", "atx_closed", "spaces" ],
"function": function MD021(params, onError) {
filterTokens(params, "heading_open", (token) => {
if (headingStyleFor(token) === "atx_closed") {

View file

@ -32,9 +32,9 @@ const getBlockQuote = (str, count) => (
);
module.exports = {
"names": [ "MD022", "blanks-around-headings", "blanks-around-headers" ],
"names": [ "MD022", "blanks-around-headings" ],
"description": "Headings should be surrounded by blank lines",
"tags": [ "headings", "headers", "blank_lines" ],
"tags": [ "headings", "blank_lines" ],
"function": function MD022(params, onError) {
const getLinesAbove = getLinesFunction(params.config.lines_above);
const getLinesBelow = getLinesFunction(params.config.lines_below);

View file

@ -7,9 +7,9 @@ const { addErrorContext, filterTokens } = require("../helpers");
const spaceBeforeHeadingRe = /^(\s+|[>\s]+\s\s)[^>\s]/;
module.exports = {
"names": [ "MD023", "heading-start-left", "header-start-left" ],
"names": [ "MD023", "heading-start-left" ],
"description": "Headings must start at the beginning of the line",
"tags": [ "headings", "headers", "spaces" ],
"tags": [ "headings", "spaces" ],
"function": function MD023(params, onError) {
filterTokens(params, "heading_open", function forToken(token) {
const { lineNumber, line } = token;

View file

@ -5,9 +5,9 @@
const { addErrorContext, forEachHeading } = require("../helpers");
module.exports = {
"names": [ "MD024", "no-duplicate-heading", "no-duplicate-header" ],
"names": [ "MD024", "no-duplicate-heading" ],
"description": "Multiple headings with the same content",
"tags": [ "headings", "headers" ],
"tags": [ "headings" ],
"function": function MD024(params, onError) {
const siblingsOnly = !!params.config.siblings_only ||
!!params.config.allow_different_nesting || false;

View file

@ -8,7 +8,7 @@ const { addErrorContext, filterTokens, frontMatterHasTitle } =
module.exports = {
"names": [ "MD025", "single-title", "single-h1" ],
"description": "Multiple top-level headings in the same document",
"tags": [ "headings", "headers" ],
"tags": [ "headings" ],
"function": function MD025(params, onError) {
const level = Number(params.config.level || 1);
const tag = "h" + level;

View file

@ -10,7 +10,7 @@ const { filterByTypes } = require("../helpers/micromark.cjs");
module.exports = {
"names": [ "MD026", "no-trailing-punctuation" ],
"description": "Trailing punctuation in heading",
"tags": [ "headings", "headers" ],
"tags": [ "headings" ],
"function": function MD026(params, onError) {
let punctuation = params.config.punctuation;
punctuation = String(

View file

@ -5,9 +5,9 @@
const { addErrorContext, allPunctuation } = require("../helpers");
module.exports = {
"names": [ "MD036", "no-emphasis-as-heading", "no-emphasis-as-header" ],
"names": [ "MD036", "no-emphasis-as-heading" ],
"description": "Emphasis used instead of a heading",
"tags": [ "headings", "headers", "emphasis" ],
"tags": [ "headings", "emphasis" ],
"function": function MD036(params, onError) {
let punctuation = params.config.punctuation;
punctuation =

View file

@ -7,7 +7,7 @@ const { addErrorContext, frontMatterHasTitle } = require("../helpers");
module.exports = {
"names": [ "MD041", "first-line-heading", "first-line-h1" ],
"description": "First line in a file should be a top-level heading",
"tags": [ "headings", "headers" ],
"tags": [ "headings" ],
"function": function MD041(params, onError) {
const level = Number(params.config.level || 1);
const tag = "h" + level;

View file

@ -6,11 +6,11 @@ const { addErrorContext, addErrorDetailIf, forEachHeading } =
require("../helpers");
module.exports = {
"names": [ "MD043", "required-headings", "required-headers" ],
"names": [ "MD043", "required-headings" ],
"description": "Required heading structure",
"tags": [ "headings", "headers" ],
"tags": [ "headings" ],
"function": function MD043(params, onError) {
const requiredHeadings = params.config.headings || params.config.headers;
const requiredHeadings = params.config.headings;
if (!Array.isArray(requiredHeadings)) {
// Nothing to check; avoid doing any work
return;