Stop using module.createRequire (problematic under webpack), incorporate and export resolveModule helper from markdownlint-cli2.

This commit is contained in:
David Anson 2025-01-12 18:27:14 -08:00
parent a1da464618
commit 53ff5c43f1
16 changed files with 327 additions and 25 deletions

View file

@ -0,0 +1,18 @@
// @ts-check
const rule = {
"names": [ "sample-rule-module" ],
"description": "Sample rule (module)",
"tags": [ "sample" ],
"function": (params, onError) => {
const hrTokens = params.tokens.filter((token) => token.type === "hr");
for (const token of hrTokens) {
onError({
"lineNumber": token.lineNumber,
"detail": "Sample error for hr"
});
}
}
};
export default rule;