mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 14:30:12 +01:00
Remove outdated type annotations and lint suppressions.
This commit is contained in:
parent
d9c5d24e20
commit
1513e3803b
25 changed files with 208 additions and 322 deletions
28
lib/md056.js
28
lib/md056.js
|
|
@ -15,21 +15,27 @@ module.exports = {
|
|||
"tags": [ "table" ],
|
||||
"parser": "micromark",
|
||||
"function": function MD056(params, onError) {
|
||||
// eslint-disable-next-line jsdoc/valid-types
|
||||
/** @type import("../helpers/micromark.cjs").Token[] */
|
||||
const micromarkTokens =
|
||||
// @ts-ignore
|
||||
params.parsers.micromark.tokens;
|
||||
const tables = filterByTypes(micromarkTokens, [ "table" ]);
|
||||
const tables = filterByTypes(
|
||||
params.parsers.micromark.tokens,
|
||||
[ "table" ]
|
||||
);
|
||||
for (const table of tables) {
|
||||
const rows = filterByTypes(table.children, [ "tableDelimiterRow", "tableRow" ]);
|
||||
const rows = filterByTypes(
|
||||
table.children,
|
||||
[ "tableDelimiterRow", "tableRow" ]
|
||||
);
|
||||
let expectedCount = 0;
|
||||
for (const row of rows) {
|
||||
const cells = filterByTypes(row.children, [ "tableData", "tableDelimiter", "tableHeader" ]);
|
||||
const cells = filterByTypes(
|
||||
row.children,
|
||||
[ "tableData", "tableDelimiter", "tableHeader" ]
|
||||
);
|
||||
const actualCount = cells.length;
|
||||
expectedCount ||= actualCount;
|
||||
let detail = null;
|
||||
let range = null;
|
||||
// eslint-disable-next-line no-undef-init
|
||||
let detail = undefined;
|
||||
// eslint-disable-next-line no-undef-init
|
||||
let range = undefined;
|
||||
if (actualCount < expectedCount) {
|
||||
detail = "Too few cells, row will be missing data";
|
||||
range = [ row.endColumn - 1, 1 ];
|
||||
|
|
@ -43,7 +49,7 @@ module.exports = {
|
|||
expectedCount,
|
||||
actualCount,
|
||||
detail,
|
||||
null,
|
||||
undefined,
|
||||
range
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue