diff --git a/.eslintignore b/.eslintignore index 905f2a39ddf..ffc34e9a954 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,7 +1,8 @@ /build/** /coverage/** -/docs/** -!/docs/.eleventy.js +/docs/* +!/docs/*.js +!/docs/tools/ /jsdoc/** /templates/** /tests/bench/** diff --git a/.eslintrc.js b/.eslintrc.js index f504850ad57..cd47323f3e9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -83,9 +83,10 @@ module.exports = { }, overrides: [ { - files: ["tools/*.js"], + files: ["tools/*.js", "docs/tools/*.js"], rules: { - "no-console": "off" + "no-console": "off", + "n/no-process-exit": "off" } }, { diff --git a/docs/postcss.config.js b/docs/postcss.config.js index 319fa67a5bc..128e741f027 100644 --- a/docs/postcss.config.js +++ b/docs/postcss.config.js @@ -1,7 +1,9 @@ +"use strict"; + module.exports = { plugins: [ - require('autoprefixer'), - require('cssnano') + require("autoprefixer"), + require("cssnano") ], map: false - } +}; diff --git a/docs/tools/validate-links.js b/docs/tools/validate-links.js index 5c1ca43578d..4d88ee7526a 100644 --- a/docs/tools/validate-links.js +++ b/docs/tools/validate-links.js @@ -1,3 +1,5 @@ +"use strict"; + const path = require("path"); const TapRender = require("@munter/tap-render"); const spot = require("tap-spot"); @@ -16,13 +18,19 @@ const skipPatterns = [ "/team", "/donate", "/docs/latest", - `src="null"`, + 'src="null"' ]; -const skipFilter = (report) => - Object.values(report).some((value) => - skipPatterns.some((pattern) => String(value).includes(pattern)) - ); +/** + * Filter function to mark tests as skipped. + * Tests for which this function returns `true' are not considered failed. + * @param {Object} report hyperlink's test report for a link. + * @returns {boolean} `true` if the report contains any of `skipPatterns`. + */ +function skipFilter(report) { + return Object.values(report).some(value => + skipPatterns.some(pattern => String(value).includes(pattern))); +} (async () => { try { @@ -35,7 +43,7 @@ const skipFilter = (report) => internalOnly: true, pretty: true, concurrency: 25, - skipFilter, + skipFilter }, tapRenderInstance ); diff --git a/eslint.config.js b/eslint.config.js index 2a9907aa075..dfed655ec36 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -85,7 +85,8 @@ module.exports = [ "build/**", "coverage/**", "docs/*", - "!docs/.eleventy.js", + "!docs/*.js", + "!docs/tools/", "jsdoc/**", "templates/**", "tests/bench/**", @@ -119,9 +120,10 @@ module.exports = [ } }, { - files: ["tools/*.js"], + files: ["tools/*.js", "docs/tools/*.js"], rules: { - "no-console": "off" + "no-console": "off", + "n/no-process-exit": "off" } }, { diff --git a/tools/fetch-docs-links.js b/tools/fetch-docs-links.js index d29dff1b3a0..9cdd05aab1a 100644 --- a/tools/fetch-docs-links.js +++ b/tools/fetch-docs-links.js @@ -99,7 +99,7 @@ async function fetchLinkMeta(url) { console.error("Could not fetch data for", url); console.error(ex.message); console.error(ex.stack); - process.exit(1); // eslint-disable-line n/no-process-exit -- used in tools + process.exit(1); } } }