mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +01:00
Add .mjs to linting, switch from eslint-plugin-node (no longer maintained) to eslint-plugin-n, update suppressions.
This commit is contained in:
parent
a2b1353db5
commit
0294b9bcc8
9 changed files with 59 additions and 56 deletions
|
|
@ -8,7 +8,6 @@ const markdownlint = require("../lib/markdownlint");
|
|||
// Parses all Markdown files in all package dependencies
|
||||
test("parseAllFiles", async(t) => {
|
||||
t.plan(1);
|
||||
// eslint-disable-next-line node/no-unsupported-features/es-syntax
|
||||
const { globby } = await import("globby");
|
||||
const files = await globby("**/*.{md,markdown}");
|
||||
await markdownlint.promises.markdownlint({ files });
|
||||
|
|
|
|||
|
|
@ -22,9 +22,7 @@ const readConfigPromise = promisify(markdownlint.readConfig);
|
|||
*/
|
||||
async function lintTestRepo(t, globPatterns, configPath, ignoreRes) {
|
||||
t.plan(1);
|
||||
// eslint-disable-next-line node/no-unsupported-features/es-syntax
|
||||
const { globby } = await import("globby");
|
||||
// eslint-disable-next-line node/no-unsupported-features/es-syntax
|
||||
const { "default": stripJsonComments } = await import("strip-json-comments");
|
||||
const jsoncParse = (json) => {
|
||||
const config = JSON.parse(stripJsonComments(json));
|
||||
|
|
|
|||
|
|
@ -1081,7 +1081,6 @@ test("validateConfigSchemaAppliesToUnknownProperties", (t) => {
|
|||
|
||||
test("validateConfigExampleJson", async(t) => {
|
||||
t.plan(2);
|
||||
// eslint-disable-next-line node/no-unsupported-features/es-syntax
|
||||
const { "default": stripJsonComments } = await import("strip-json-comments");
|
||||
// Validate JSONC
|
||||
const fileJson = ".markdownlint.jsonc";
|
||||
|
|
@ -1357,7 +1356,6 @@ test("configParsersJSON", async(t) => {
|
|||
|
||||
test("configParsersJSONC", async(t) => {
|
||||
t.plan(1);
|
||||
// eslint-disable-next-line node/no-unsupported-features/es-syntax
|
||||
const { "default": stripJsonComments } = await import("strip-json-comments");
|
||||
const options = {
|
||||
"strings": {
|
||||
|
|
@ -1401,7 +1399,6 @@ test("configParsersYAML", async(t) => {
|
|||
|
||||
test("configParsersTOML", async(t) => {
|
||||
t.plan(1);
|
||||
// eslint-disable-next-line node/no-unsupported-features/es-syntax
|
||||
const { "default": stripJsonComments } = await import("strip-json-comments");
|
||||
const options = {
|
||||
"strings": {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@ const strings = {
|
|||
|
||||
const start = new Date();
|
||||
for (let i = 0; i < 250; i++) {
|
||||
await markdownlint({strings});
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await markdownlint({ strings });
|
||||
}
|
||||
const end = new Date();
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Elapsed: ${end - start}`);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ const languageJavaScript = /js|javascript/i;
|
|||
function cleanJsdocRulesFromEslintConfig(config) {
|
||||
const cleanedConfig = { ...config };
|
||||
for (const rule in config.rules) {
|
||||
if (/^(es|jsdoc|node|unicorn)\//.test(rule)) {
|
||||
if (/^(es|jsdoc|n|unicorn)\//.test(rule)) {
|
||||
delete cleanedConfig.rules[rule];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ module.exports = {
|
|||
"tags": [ "test", "validate", "json" ],
|
||||
"asynchronous": true,
|
||||
"function": async(params, onError) => {
|
||||
// eslint-disable-next-line max-len, node/no-unsupported-features/es-syntax
|
||||
const { "default": stripJsonComments } = await import("strip-json-comments");
|
||||
const { "default": stripJsonComments } =
|
||||
await import("strip-json-comments");
|
||||
filterTokens(params, "fence", (fence) => {
|
||||
if (/jsonc?/i.test(fence.info)) {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue