Add .mjs to linting, switch from eslint-plugin-node (no longer maintained) to eslint-plugin-n, update suppressions.

This commit is contained in:
David Anson 2022-10-26 03:26:59 +00:00
parent a2b1353db5
commit 0294b9bcc8
9 changed files with 59 additions and 56 deletions

View file

@ -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];
}
}

View file

@ -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 {