Add "enabled" and "severity"/"warning" to rule in Configuration object, add corresponding documentation and tests, update demo web app (fixes #254)”.
Some checks failed
Checkers / linkcheck (push) Has been cancelled
Checkers / spellcheck (push) Has been cancelled
CI / build (20, macos-latest) (push) Has been cancelled
CI / build (20, ubuntu-latest) (push) Has been cancelled
CI / build (20, windows-latest) (push) Has been cancelled
CI / build (22, macos-latest) (push) Has been cancelled
CI / build (22, ubuntu-latest) (push) Has been cancelled
CI / build (22, windows-latest) (push) Has been cancelled
CI / build (24, macos-latest) (push) Has been cancelled
CI / build (24, ubuntu-latest) (push) Has been cancelled
CI / build (24, windows-latest) (push) Has been cancelled
CI / pnpm (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
TestRepos / build (latest, ubuntu-latest) (push) Has been cancelled
UpdateTestRepos / update (push) Has been cancelled

This commit is contained in:
David Anson 2025-09-22 21:39:09 -07:00
parent 87ddc2e022
commit 0f5a8c701e
20 changed files with 3792 additions and 867 deletions

View file

@ -0,0 +1,47 @@
# Configure File Off Enable Inline
+ List item
Text (text)[.]
<!-- markdownlint-disable -->
+ List item
Text (text)[.]
<!-- markdownlint-restore -->
+ List item
Text (text)[.]
<!-- markdownlint-enable MD004 MD011 -->
+ List item {MD004}
Text (text)[.] {MD011}
<!-- markdownlint-disable -->
+ List item
Text (text)[.]
<!-- markdownlint-enable MD004 MD011 -->
+ List item {MD004}
Text (text)[.] {MD011}
<!-- markdownlint-configure-file {
"MD004": {
"enabled": false,
"severity": "warning",
"style": "dash"
},
"MD011": {
"enabled": false,
"severity": "error"
}
} -->

View file

@ -0,0 +1,58 @@
# Configure File With Severity Alias
Text * text* {MD037}
Text ` text` {MD038}
Text [ text](.)
+ List item {MD004}
Text (text)[.] {MD011}
2. List item
<!-- markdownlint-disable -->
Text * text*
Text ` text`
Text [ text](.)
+ List item
Text (text)[.]
2. List item
<!-- markdownlint-restore -->
Text * text* {MD037}
Text ` text` {MD038}
Text [ text](.)
+ List item {MD004}
Text (text)[.] {MD011}
2. List item
<!-- markdownlint-configure-file {
"default": false,
"no-space-in-emphasis": "error",
"no-space-in-code": "warning",
"no-space-in-links": false,
"ul-style": {
"severity": "error",
"style": "dash"
},
"no-reversed-links": {
"severity": "warning"
},
"ol-prefix": {
"enabled": false
}
} -->

View file

@ -1,16 +1,16 @@
# Configure File With Severity
# Configure File With Severity Name
Text * text* {MD037}
Text ` text` {MD038}
Text [ text](.) {MD039}
Text [ text](.)
+ List item {MD004}
Text (text)[.] {MD011}
2. List item {MD029}
2. List item
<!-- markdownlint-disable -->
@ -32,27 +32,27 @@ Text * text* {MD037}
Text ` text` {MD038}
Text [ text](.) {MD039}
Text [ text](.)
+ List item {MD004}
Text (text)[.] {MD011}
2. List item {MD029}
2. List item
<!-- markdownlint-configure-file {
"default": false,
"MD037": "error",
"MD038": "error",
"MD039": "error",
"MD038": "warning",
"MD039": false,
"MD004": {
"severity": "error",
"style": "dash"
},
"MD011": {
"severity": "error"
"severity": "warning"
},
"MD029": {
"severity": "error"
"enabled": false
}
} -->

View file

@ -0,0 +1,50 @@
# Configure File With Severity Tag
Text * text* {MD037}
Text ` text` {MD038}
Text [ text](.) {MD039}
+ List item
Text (text)[.] {MD011}
2. List item {MD029}
<!-- markdownlint-disable -->
Text * text*
Text ` text`
Text [ text](.)
+ List item
Text (text)[.]
2. List item
<!-- markdownlint-restore -->
Text * text* {MD037}
Text ` text` {MD038}
Text [ text](.) {MD039}
+ List item
Text (text)[.] {MD011}
2. List item {MD029}
<!-- markdownlint-configure-file {
"default": false,
"emphasis": "error",
"code": "warning",
"bullet": false,
"links": "warning",
"ol": "error"
} -->

View file

@ -2037,7 +2037,7 @@ test("customRulesParamsAreFrozen", (t) => {
const pending = [ params ];
let current = null;
while ((current = pending.shift())) {
t.true(Object.isFrozen(current) || (current === params));
t.true(Object.isFrozen(current));
for (const name of Object.getOwnPropertyNames(current)) {
// @ts-ignore
const value = current[name];
@ -2083,7 +2083,7 @@ test("customRulesParamsAreFrozen", (t) => {
});
test("customRulesParamsAreStable", (t) => {
t.plan(6);
t.plan(4);
const config1 = { "value1": 10 };
const config2 = { "value2": 20 };
/** @type {import("markdownlint").Options} */
@ -2108,7 +2108,6 @@ test("customRulesParamsAreStable", (t) => {
t.deepEqual(config, config1, `Unexpected config in sync path: ${config}.`);
return Promise.resolve().then(() => {
t.deepEqual(config, config1, `Unexpected config in async path: ${config}.`);
config.extra = 1;
});
}
},
@ -2124,7 +2123,6 @@ test("customRulesParamsAreStable", (t) => {
t.deepEqual(config, config2, `Unexpected config in sync path: ${config}.`);
return Promise.resolve().then(() => {
t.deepEqual(config, config2, `Unexpected config in async path: ${config}.`);
config.extra = 2;
});
}
}
@ -2133,10 +2131,7 @@ test("customRulesParamsAreStable", (t) => {
"string": "# Heading"
}
};
return lintPromise(options).then(() => {
t.deepEqual(config1, { "value1": 10 });
t.deepEqual(config2, { "value2": 20 });
});
return lintPromise(options);
});
test("customRulesParamsAreExpected", (t) => {
@ -2155,7 +2150,7 @@ test("customRulesParamsAreExpected", (t) => {
"description": "description",
"tags": [ "tag" ],
"parser": "none",
"function": (params) => t.deepEqual(params.config, true)
"function": (params) => t.deepEqual(params.config, {})
},
{
"names": [ "name2" ],

View file

@ -347,6 +347,7 @@ test("getPreferredLineEnding", (t) => {
const actual = helpers.getPreferredLineEnding(input);
t.is(actual, expected, "Incorrect line ending returned.");
}
// @ts-ignore
t.is(helpers.getPreferredLineEnding("", null), "\n");
t.is(helpers.getPreferredLineEnding("", { "EOL": "\n" }), "\n");
t.is(helpers.getPreferredLineEnding("", { "EOL": "\r\n" }), "\r\n");
@ -358,29 +359,37 @@ test("expandTildePath", (t) => {
const homedir = os.homedir();
t.is(helpers.expandTildePath("", os), "");
t.is(helpers.expandTildePath("", {}), "");
// @ts-ignore
t.is(helpers.expandTildePath("", null), "");
t.is(
path.resolve(helpers.expandTildePath("~", os)),
homedir
);
// @ts-ignore
t.is(helpers.expandTildePath("~", null), "~");
t.is(helpers.expandTildePath("file", os), "file");
// @ts-ignore
t.is(helpers.expandTildePath("file", null), "file");
t.is(helpers.expandTildePath("/file", os), "/file");
// @ts-ignore
t.is(helpers.expandTildePath("/file", null), "/file");
t.is(
path.resolve(helpers.expandTildePath("~/file", os)),
path.join(homedir, "/file")
);
// @ts-ignore
t.is(helpers.expandTildePath("~/file", null), "~/file");
t.is(helpers.expandTildePath("dir/file", os), "dir/file");
// @ts-ignore
t.is(helpers.expandTildePath("dir/file", null), "dir/file");
t.is(helpers.expandTildePath("/dir/file", os), "/dir/file");
// @ts-ignore
t.is(helpers.expandTildePath("/dir/file", null), "/dir/file");
t.is(
path.resolve(helpers.expandTildePath("~/dir/file", os)),
path.join(homedir, "/dir/file")
);
// @ts-ignore
t.is(helpers.expandTildePath("~/dir/file", null), "~/dir/file");
});
@ -396,6 +405,7 @@ test("getReferenceLinkImageData().shortcuts", (t) => {
"parser": "none",
"function":
() => {
// @ts-ignore
const { shortcuts } = getReferenceLinkImageData();
t.is(shortcuts.size, 0, [ ...shortcuts.keys() ].join(", "));
}
@ -533,14 +543,14 @@ test("hasOverlap", (t) => {
test("formatLintResults", async(t) => {
t.plan(2);
t.deepEqual(formatLintResults(undefined), []);
const lintResults = await lint({ "strings": { "content": "# Heading\n<br/>" } });
const lintResults = await lint({ "strings": { "content": "# Heading\n<br/><!-- markdownlint-configure-file { \"MD033\": \"warning\" } -->" } });
t.deepEqual(
formatLintResults(lintResults),
[
"content:1:3 error MD019/no-multiple-space-atx Multiple spaces after hash on atx style heading [Context: \"# Heading\"]",
"content:1 error MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: \"# Heading\"]",
"content:2:1 error MD033/no-inline-html Inline HTML [Element: br]",
"content:2:5 error MD047/single-trailing-newline Files should end with a single newline character"
"content:2:1 warning MD033/no-inline-html Inline HTML [Element: br]",
"content:2:64 error MD047/single-trailing-newline Files should end with a single newline character"
]
);
});

View file

@ -190,6 +190,16 @@ function getConfigTestImplementation(config, expected) {
};
}
/**
* Converts a config test scenario from errors to warnings.
*
* @param {Object.<string, string[]>} configTest Config test scenario.
* @returns {Object.<string, string[]>} Converted scenario.
*/
function configTestAsWarnings(configTest) {
return JSON.parse(JSON.stringify(configTest).replaceAll("error", "warning"));
}
const configTestExpected = {
"./test/atx_heading_spacing.md": [],
"./test/first_heading_bad_atx.md": []
@ -273,13 +283,23 @@ test("defaultError", getConfigTestImplementation(
test("defaultWarning", getConfigTestImplementation(
// @ts-ignore
{ "default": "warning" },
configTestAsWarnings(configTestExpected13511)
));
test("defaultMultipleTrue", getConfigTestImplementation(
{
"default": true,
"DEFAULT": false
},
configTestExpected13511
));
test("defaultOff", getConfigTestImplementation(
// @ts-ignore
{ "default": "off" },
configTestExpected13511
test("defaultMultipleFalse", getConfigTestImplementation(
{
"DEFAULT": false,
"default": true
},
configTestExpected
));
test("disableRules", getConfigTestImplementation(
@ -336,7 +356,7 @@ test("enableRulesTruthy", getConfigTestImplementation(
configTestExpected3511
));
test("enableRulesString", getConfigTestImplementation(
test("enableRulesError", getConfigTestImplementation(
{
"MD041": "error",
"default": false,
@ -346,6 +366,16 @@ test("enableRulesString", getConfigTestImplementation(
configTestExpected3511
));
test("enableRulesWarning", getConfigTestImplementation(
{
"MD041": "warning",
"default": false,
"no-multiple-space-atx": "warning",
"extra": "warning"
},
configTestAsWarnings(configTestExpected3511)
));
test("enableRulesObjectEmpty", getConfigTestImplementation(
{
"MD041": {},
@ -356,7 +386,7 @@ test("enableRulesObjectEmpty", getConfigTestImplementation(
configTestExpected3511
));
test("enableRulesObjectTruthy", getConfigTestImplementation(
test("enableRulesObjectSeverityTruthy", getConfigTestImplementation(
{
"MD041": {
// @ts-ignore
@ -374,7 +404,7 @@ test("enableRulesObjectTruthy", getConfigTestImplementation(
configTestExpected3511
));
test("enableRulesObjectFalsy", getConfigTestImplementation(
test("enableRulesObjectSeverityFalsy", getConfigTestImplementation(
{
"MD041": {
// @ts-ignore
@ -392,7 +422,7 @@ test("enableRulesObjectFalsy", getConfigTestImplementation(
configTestExpected3511
));
test("enableRulesObjectError", getConfigTestImplementation(
test("enableRulesObjectSeverityError", getConfigTestImplementation(
{
"MD041": {
"severity": "error"
@ -408,42 +438,90 @@ test("enableRulesObjectError", getConfigTestImplementation(
configTestExpected3511
));
test("enableRulesObjectWarning", getConfigTestImplementation(
test("enableRulesObjectSeverityWarning", getConfigTestImplementation(
{
"MD041": {
// @ts-ignore
"severity": "warning"
},
"default": false,
"no-multiple-space-atx": {
// @ts-ignore
"severity": "warning"
},
"extra": {
"severity": "warning"
}
},
configTestAsWarnings(configTestExpected3511)
));
test("enableRulesObjectEnabledTrue", getConfigTestImplementation(
{
"MD041": {
"enabled": true
},
"default": false,
"no-multiple-space-atx": {
"enabled": true
},
"extra": {
"enabled": true
}
},
configTestExpected3511
));
test("enableRulesObjectOff", getConfigTestImplementation(
test("enableRulesObjectEnabledFalse", getConfigTestImplementation(
{
"MD041": {
"enabled": false
},
"default": true,
"no-multiple-space-atx": {
"enabled": false
},
"extra": {
"enabled": false
}
},
configTestExpected1
));
test("enableRulesObjectEnabledTruthy", getConfigTestImplementation(
{
"MD041": {
// @ts-ignore
"severity": "off"
"enabled": 1
},
"default": false,
"no-multiple-space-atx": {
// @ts-ignore
"severity": "off"
"enabled": 1
},
"extra": {
"severity": "off"
"enabled": 1
}
},
configTestExpected3511
));
test("enableRulesObjectEnabledFalsy", getConfigTestImplementation(
{
"MD041": {
// @ts-ignore
"enabled": 0
},
"default": true,
"no-multiple-space-atx": {
// @ts-ignore
"enabled": 0
},
"extra": {
"enabled": 0
}
},
configTestExpected1
));
test("disableTag", getConfigTestImplementation(
{
"default": true,
@ -491,7 +569,7 @@ test("enableTagTruthy", getConfigTestImplementation(
configTestExpected135
));
test("enableTagString", getConfigTestImplementation(
test("enableTagError", getConfigTestImplementation(
{
"default": false,
"spaces": "error",
@ -500,6 +578,15 @@ test("enableTagString", getConfigTestImplementation(
configTestExpected135
));
test("enableTagWarning", getConfigTestImplementation(
{
"default": false,
"spaces": "warning",
"extra": "warning"
},
configTestAsWarnings(configTestExpected135)
));
test("styleFiles", async(t) => {
t.plan(8);
const files = await fs.promises.readdir("./style");
@ -1008,7 +1095,7 @@ test("readme", async(t) => {
});
test("validateJsonUsingConfigSchemaStrict", async(t) => {
t.plan(212);
t.plan(215);
// @ts-ignore
const ajv = new Ajv(ajvOptions);
const validateSchemaStrict = ajv.compile(configSchemaStrict);

View file

@ -11203,7 +11203,148 @@ Generated by [AVA](https://avajs.dev).
`,
}
## configure-file-with-severity.md
## configure-file-off-enable-inline.md
> Snapshot 1
{
errors: [
{
errorContext: null,
errorDetail: 'Expected: dash; Actual: plus',
errorRange: [
1,
1,
],
fixInfo: {
deleteCount: 1,
editColumn: 1,
insertText: '-',
},
lineNumber: 21,
ruleDescription: 'Unordered list style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md',
ruleNames: [
'MD004',
'ul-style',
],
severity: 'warning',
},
{
errorContext: null,
errorDetail: 'Expected: dash; Actual: plus',
errorRange: [
1,
1,
],
fixInfo: {
deleteCount: 1,
editColumn: 1,
insertText: '-',
},
lineNumber: 33,
ruleDescription: 'Unordered list style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md',
ruleNames: [
'MD004',
'ul-style',
],
severity: 'warning',
},
{
errorContext: null,
errorDetail: '(text)[.]',
errorRange: [
6,
9,
],
fixInfo: {
deleteCount: 9,
editColumn: 6,
insertText: '[text](.)',
},
lineNumber: 23,
ruleDescription: 'Reversed link syntax',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md',
ruleNames: [
'MD011',
'no-reversed-links',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: '(text)[.]',
errorRange: [
6,
9,
],
fixInfo: {
deleteCount: 9,
editColumn: 6,
insertText: '[text](.)',
},
lineNumber: 35,
ruleDescription: 'Reversed link syntax',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md',
ruleNames: [
'MD011',
'no-reversed-links',
],
severity: 'error',
},
],
fixed: `# Configure File Off Enable Inline␊
+ List item␊
Text (text)[.]␊
<!-- markdownlint-disable -->
+ List item␊
Text (text)[.]␊
<!-- markdownlint-restore -->
+ List item␊
Text (text)[.]␊
<!-- markdownlint-enable MD004 MD011 -->
- List item {MD004}␊
Text [text](.) {MD011}␊
<!-- markdownlint-disable -->
+ List item␊
Text (text)[.]␊
<!-- markdownlint-enable MD004 MD011 -->
- List item {MD004}␊
Text [text](.) {MD011}␊
<!-- markdownlint-configure-file {␊
"MD004": {␊
"enabled": false,␊
"severity": "warning",␊
"style": "dash"␊
},␊
"MD011": {␊
"enabled": false,␊
"severity": "error"␊
}␊
} -->␊
`,
}
## configure-file-with-severity-alias.md
> Snapshot 1
@ -11270,7 +11411,7 @@ Generated by [AVA](https://avajs.dev).
'MD011',
'no-reversed-links',
],
severity: 'error',
severity: 'warning',
},
{
errorContext: null,
@ -11291,8 +11432,430 @@ Generated by [AVA](https://avajs.dev).
'MD011',
'no-reversed-links',
],
severity: 'warning',
},
{
errorContext: '* t',
errorDetail: null,
errorRange: [
7,
1,
],
fixInfo: {
deleteCount: 1,
editColumn: 7,
},
lineNumber: 3,
ruleDescription: 'Spaces inside emphasis markers',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
ruleNames: [
'MD037',
'no-space-in-emphasis',
],
severity: 'error',
},
{
errorContext: '* t',
errorDetail: null,
errorRange: [
7,
1,
],
fixInfo: {
deleteCount: 1,
editColumn: 7,
},
lineNumber: 31,
ruleDescription: 'Spaces inside emphasis markers',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
ruleNames: [
'MD037',
'no-space-in-emphasis',
],
severity: 'error',
},
{
errorContext: '` text`',
errorDetail: null,
errorRange: [
7,
1,
],
fixInfo: {
deleteCount: 1,
editColumn: 7,
},
lineNumber: 5,
ruleDescription: 'Spaces inside code span elements',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md',
ruleNames: [
'MD038',
'no-space-in-code',
],
severity: 'warning',
},
{
errorContext: '` text`',
errorDetail: null,
errorRange: [
7,
1,
],
fixInfo: {
deleteCount: 1,
editColumn: 7,
},
lineNumber: 33,
ruleDescription: 'Spaces inside code span elements',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md',
ruleNames: [
'MD038',
'no-space-in-code',
],
severity: 'warning',
},
],
fixed: `# Configure File With Severity Alias␊
Text *text* {MD037}␊
Text \`text\` {MD038}␊
Text [ text](.)␊
- List item {MD004}␊
Text [text](.) {MD011}␊
2. List item␊
<!-- markdownlint-disable -->
Text * text*
Text \` text\`␊
Text [ text](.)␊
+ List item␊
Text (text)[.]␊
2. List item␊
<!-- markdownlint-restore -->
Text *text* {MD037}␊
Text \`text\` {MD038}␊
Text [ text](.)␊
- List item {MD004}␊
Text [text](.) {MD011}␊
2. List item␊
<!-- markdownlint-configure-file {␊
"default": false,␊
"no-space-in-emphasis": "error",␊
"no-space-in-code": "warning",␊
"no-space-in-links": false,␊
"ul-style": {␊
"severity": "error",␊
"style": "dash"␊
},␊
"no-reversed-links": {␊
"severity": "warning"␊
},␊
"ol-prefix": {␊
"enabled": false␊
}␊
} -->␊
`,
}
## configure-file-with-severity-name.md
> Snapshot 1
{
errors: [
{
errorContext: null,
errorDetail: 'Expected: dash; Actual: plus',
errorRange: [
1,
1,
],
fixInfo: {
deleteCount: 1,
editColumn: 1,
insertText: '-',
},
lineNumber: 9,
ruleDescription: 'Unordered list style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md',
ruleNames: [
'MD004',
'ul-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: 'Expected: dash; Actual: plus',
errorRange: [
1,
1,
],
fixInfo: {
deleteCount: 1,
editColumn: 1,
insertText: '-',
},
lineNumber: 37,
ruleDescription: 'Unordered list style',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md',
ruleNames: [
'MD004',
'ul-style',
],
severity: 'error',
},
{
errorContext: null,
errorDetail: '(text)[.]',
errorRange: [
6,
9,
],
fixInfo: {
deleteCount: 9,
editColumn: 6,
insertText: '[text](.)',
},
lineNumber: 11,
ruleDescription: 'Reversed link syntax',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md',
ruleNames: [
'MD011',
'no-reversed-links',
],
severity: 'warning',
},
{
errorContext: null,
errorDetail: '(text)[.]',
errorRange: [
6,
9,
],
fixInfo: {
deleteCount: 9,
editColumn: 6,
insertText: '[text](.)',
},
lineNumber: 39,
ruleDescription: 'Reversed link syntax',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md',
ruleNames: [
'MD011',
'no-reversed-links',
],
severity: 'warning',
},
{
errorContext: '* t',
errorDetail: null,
errorRange: [
7,
1,
],
fixInfo: {
deleteCount: 1,
editColumn: 7,
},
lineNumber: 3,
ruleDescription: 'Spaces inside emphasis markers',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
ruleNames: [
'MD037',
'no-space-in-emphasis',
],
severity: 'error',
},
{
errorContext: '* t',
errorDetail: null,
errorRange: [
7,
1,
],
fixInfo: {
deleteCount: 1,
editColumn: 7,
},
lineNumber: 31,
ruleDescription: 'Spaces inside emphasis markers',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
ruleNames: [
'MD037',
'no-space-in-emphasis',
],
severity: 'error',
},
{
errorContext: '` text`',
errorDetail: null,
errorRange: [
7,
1,
],
fixInfo: {
deleteCount: 1,
editColumn: 7,
},
lineNumber: 5,
ruleDescription: 'Spaces inside code span elements',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md',
ruleNames: [
'MD038',
'no-space-in-code',
],
severity: 'warning',
},
{
errorContext: '` text`',
errorDetail: null,
errorRange: [
7,
1,
],
fixInfo: {
deleteCount: 1,
editColumn: 7,
},
lineNumber: 33,
ruleDescription: 'Spaces inside code span elements',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md',
ruleNames: [
'MD038',
'no-space-in-code',
],
severity: 'warning',
},
],
fixed: `# Configure File With Severity Name␊
Text *text* {MD037}␊
Text \`text\` {MD038}␊
Text [ text](.)␊
- List item {MD004}␊
Text [text](.) {MD011}␊
2. List item␊
<!-- markdownlint-disable -->
Text * text*
Text \` text\`␊
Text [ text](.)␊
+ List item␊
Text (text)[.]␊
2. List item␊
<!-- markdownlint-restore -->
Text *text* {MD037}␊
Text \`text\` {MD038}␊
Text [ text](.)␊
- List item {MD004}␊
Text [text](.) {MD011}␊
2. List item␊
<!-- markdownlint-configure-file {␊
"default": false,␊
"MD037": "error",␊
"MD038": "warning",␊
"MD039": false,␊
"MD004": {␊
"severity": "error",␊
"style": "dash"␊
},␊
"MD011": {␊
"severity": "warning"␊
},␊
"MD029": {␊
"enabled": false␊
}␊
} -->␊
`,
}
## configure-file-with-severity-tag.md
> Snapshot 1
{
errors: [
{
errorContext: null,
errorDetail: '(text)[.]',
errorRange: [
6,
9,
],
fixInfo: {
deleteCount: 9,
editColumn: 6,
insertText: '[text](.)',
},
lineNumber: 11,
ruleDescription: 'Reversed link syntax',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md',
ruleNames: [
'MD011',
'no-reversed-links',
],
severity: 'warning',
},
{
errorContext: null,
errorDetail: '(text)[.]',
errorRange: [
6,
9,
],
fixInfo: {
deleteCount: 9,
editColumn: 6,
insertText: '[text](.)',
},
lineNumber: 39,
ruleDescription: 'Reversed link syntax',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md011.md',
ruleNames: [
'MD011',
'no-reversed-links',
],
severity: 'warning',
},
{
errorContext: null,
errorDetail: 'Expected: 1; Actual: 2; Style: 1/1/1',
@ -11393,7 +11956,7 @@ Generated by [AVA](https://avajs.dev).
'MD038',
'no-space-in-code',
],
severity: 'error',
severity: 'warning',
},
{
errorContext: '` text`',
@ -11413,7 +11976,7 @@ Generated by [AVA](https://avajs.dev).
'MD038',
'no-space-in-code',
],
severity: 'error',
severity: 'warning',
},
{
errorContext: '[ text]',
@ -11433,7 +11996,7 @@ Generated by [AVA](https://avajs.dev).
'MD039',
'no-space-in-links',
],
severity: 'error',
severity: 'warning',
},
{
errorContext: '[ text]',
@ -11453,10 +12016,10 @@ Generated by [AVA](https://avajs.dev).
'MD039',
'no-space-in-links',
],
severity: 'error',
severity: 'warning',
},
],
fixed: `# Configure File With Severity␊
fixed: `# Configure File With Severity Tag
Text *text* {MD037}␊
@ -11464,7 +12027,7 @@ Generated by [AVA](https://avajs.dev).
Text [text](.) {MD039}␊
- List item {MD004}
+ List item
Text [text](.) {MD011}␊
@ -11492,7 +12055,7 @@ Generated by [AVA](https://avajs.dev).
Text [text](.) {MD039}␊
- List item {MD004}
+ List item
Text [text](.) {MD011}␊
@ -11500,19 +12063,11 @@ Generated by [AVA](https://avajs.dev).
<!-- markdownlint-configure-file {␊
"default": false,␊
"MD037": "error",␊
"MD038": "error",␊
"MD039": "error",␊
"MD004": {␊
"severity": "error",␊
"style": "dash"␊
},␊
"MD011": {␊
"severity": "error"␊
},␊
"MD029": {␊
"severity": "error"␊
}␊
"emphasis": "error",␊
"code": "warning",␊
"bullet": false,␊
"links": "warning",␊
"ol": "error"␊
} -->␊
`,
}