mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Address new lint issues from previous commit.
This commit is contained in:
parent
3a3416f15e
commit
2d48be6694
3 changed files with 14 additions and 15 deletions
|
|
@ -43,11 +43,10 @@ for (const rule of rules) {
|
||||||
`<a name="${name.toLowerCase()}"></a>`,
|
`<a name="${name.toLowerCase()}"></a>`,
|
||||||
""
|
""
|
||||||
);
|
);
|
||||||
const section = [];
|
const section = [
|
||||||
section.push(
|
|
||||||
`## ${decorator}\`${name}\` - ${rule.description}${decorator}`,
|
`## ${decorator}\`${name}\` - ${rule.description}${decorator}`,
|
||||||
""
|
""
|
||||||
);
|
];
|
||||||
if (deprecated) {
|
if (deprecated) {
|
||||||
section.push(
|
section.push(
|
||||||
"> This rule is deprecated and provided for backward-compatibility",
|
"> This rule is deprecated and provided for backward-compatibility",
|
||||||
|
|
|
||||||
|
|
@ -142,11 +142,10 @@ export function getEvents(
|
||||||
.trim();
|
.trim();
|
||||||
if ((text.length > 0) && !text.includes("]")) {
|
if ((text.length > 0) && !text.includes("]")) {
|
||||||
/** @type {Event[]} */
|
/** @type {Event[]} */
|
||||||
const artificialEvents = [];
|
const artificialEvents = [
|
||||||
artificialEvents.push(
|
|
||||||
[ "enter", undefinedReferenceType, tokenizeContext ],
|
[ "enter", undefinedReferenceType, tokenizeContext ],
|
||||||
[ "enter", undefinedReference, tokenizeContext ]
|
[ "enter", undefinedReference, tokenizeContext ]
|
||||||
);
|
];
|
||||||
for (const event of eventsToReplicate) {
|
for (const event of eventsToReplicate) {
|
||||||
const [ kind, token ] = event;
|
const [ kind, token ] = event;
|
||||||
// Copy token because the current object will get modified by the parser
|
// Copy token because the current object will get modified by the parser
|
||||||
|
|
|
||||||
|
|
@ -400,12 +400,12 @@ test("customRulesNpmPackage", (t) => new Promise((resolve) => {
|
||||||
};
|
};
|
||||||
lintAsync(options, function callback(err, actualResult) {
|
lintAsync(options, function callback(err, actualResult) {
|
||||||
t.falsy(err);
|
t.falsy(err);
|
||||||
const expectedResult = {};
|
const expectedResult = {
|
||||||
expectedResult.string = {
|
"string": {
|
||||||
"extended-ascii": [ 5 ],
|
"extended-ascii": [ 5 ],
|
||||||
"sample-rule": [ 3 ]
|
"sample-rule": [ 3 ]
|
||||||
|
}
|
||||||
};
|
};
|
||||||
// @ts-ignore
|
|
||||||
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
|
|
@ -448,9 +448,10 @@ test("customRulesBadProperty", (t) => {
|
||||||
]) {
|
]) {
|
||||||
const { propertyName, propertyValues } = testCase;
|
const { propertyName, propertyValues } = testCase;
|
||||||
for (const propertyValue of propertyValues) {
|
for (const propertyValue of propertyValues) {
|
||||||
const badRule = { ...customRules.firstLine };
|
const badRule = {
|
||||||
// @ts-ignore
|
...customRules.firstLine,
|
||||||
badRule[propertyName] = propertyValue;
|
[propertyName]: propertyValue
|
||||||
|
};
|
||||||
/** @type {import("markdownlint").Options} */
|
/** @type {import("markdownlint").Options} */
|
||||||
const options = {
|
const options = {
|
||||||
"customRules": [ badRule ]
|
"customRules": [ badRule ]
|
||||||
|
|
@ -1952,7 +1953,7 @@ test("customRulesValidateJson", (t) => new Promise((resolve) => {
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
t.true(
|
t.true(
|
||||||
actual && (actual["test/validate-json.md"][0].errorDetail.length > 0),
|
actual && (actual["test/validate-json.md"][0].errorDetail?.length !== 0),
|
||||||
"Missing errorDetail"
|
"Missing errorDetail"
|
||||||
);
|
);
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue