From 0d910706ef4efa3a20e86d320ac95dd79e2dc624 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 1 Apr 2025 10:36:12 +0200 Subject: [PATCH] tools: enable linter on some fixtures file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/57674 Reviewed-By: Michaƫl Zasso Reviewed-By: Moshe Atlow --- eslint.config.mjs | 30 +++++++++++++++++------------- test/eslint.config_partial.mjs | 2 +- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 085f86174ff..45ee3455226 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -14,6 +14,7 @@ import { } from './tools/eslint/eslint.config_utils.mjs'; import nodeCore from './tools/eslint/eslint-plugin-node-core.js'; +const { globalIgnores } = await importEslintTool('eslint/config'); const { default: js } = await importEslintTool('@eslint/js'); const { default: babelEslintParser } = await importEslintTool('@babel/eslint-parser'); const babelPluginSyntaxImportAttributes = resolveEslintTool('@babel/plugin-syntax-import-attributes'); @@ -39,19 +40,22 @@ Module._resolveFilename = (request, parent, isMain, options) => { export default [ // #region ignores - { - ignores: [ - '**/node_modules/**', - 'benchmark/fixtures/**', - 'benchmark/tmp/**', - 'doc/changelogs/CHANGELOG_V1*.md', - '!doc/changelogs/CHANGELOG_V18.md', - 'lib/punycode.js', - 'test/.tmp.*/**', - 'test/addons/??_*', - 'test/fixtures/**', - ], - }, + globalIgnores([ + '**/node_modules/**', + 'benchmark/fixtures/**', + 'benchmark/tmp/**', + 'doc/changelogs/CHANGELOG_V1*.md', + '!doc/changelogs/CHANGELOG_V18.md', + 'lib/punycode.js', + 'test/.tmp.*/**', + 'test/addons/??_*', + + // We want to lint only a few specific fixtures folders + 'test/fixtures/*', + '!test/fixtures/console', + '!test/fixtures/v8', + '!test/fixtures/vm', + ]), // #endregion // #region general config js.configs.recommended, diff --git a/test/eslint.config_partial.mjs b/test/eslint.config_partial.mjs index 417007ef68d..418b2d0c3c8 100644 --- a/test/eslint.config_partial.mjs +++ b/test/eslint.config_partial.mjs @@ -139,7 +139,7 @@ export default [ }, { files: [ - 'test/{common,wpt}/**/*.{js,mjs,cjs}', + 'test/{common,fixtures,wpt}/**/*.{js,mjs,cjs}', 'test/eslint.config_partial.mjs', ], rules: {