diff --git a/Makefile b/Makefile index 81a92cfaf6d..9291c73e568 100644 --- a/Makefile +++ b/Makefile @@ -1188,6 +1188,7 @@ $(TARBALL): release-only doc-only $(RM) -r $(TARNAME)/doc/images # too big $(RM) -r $(TARNAME)/test*.tap $(RM) -r $(TARNAME)/tools/cpplint.py + $(RM) -r $(TARNAME)/tools/eslint $(RM) -r $(TARNAME)/tools/eslint-rules $(RM) -r $(TARNAME)/tools/license-builder.sh $(RM) -r $(TARNAME)/tools/node_modules diff --git a/benchmark/eslint.config_partial.mjs b/benchmark/eslint.config_partial.mjs index b980450add2..174d8848c99 100644 --- a/benchmark/eslint.config_partial.mjs +++ b/benchmark/eslint.config_partial.mjs @@ -1,4 +1,4 @@ -import { requireEslintTool } from '../tools/eslint.config_utils.mjs'; +import { requireEslintTool } from '../tools/eslint/eslint.config_utils.mjs'; const globals = requireEslintTool('globals'); diff --git a/doc/eslint.config_partial.mjs b/doc/eslint.config_partial.mjs index bb195cbe539..add5ab3d8d6 100644 --- a/doc/eslint.config_partial.mjs +++ b/doc/eslint.config_partial.mjs @@ -1,4 +1,4 @@ -import { requireEslintTool } from '../tools/eslint.config_utils.mjs'; +import { requireEslintTool } from '../tools/eslint/eslint.config_utils.mjs'; const globals = requireEslintTool('globals'); diff --git a/eslint.config.mjs b/eslint.config.mjs index e9ac911a666..a2d2e591765 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -5,13 +5,14 @@ import benchmarkConfig from './benchmark/eslint.config_partial.mjs'; import docConfig from './doc/eslint.config_partial.mjs'; import libConfig from './lib/eslint.config_partial.mjs'; import testConfig from './test/eslint.config_partial.mjs'; -import toolsConfig from './tools/eslint.config_partial.mjs'; +import toolsConfig from './tools/eslint/eslint.config_partial.mjs'; import { noRestrictedSyntaxCommonAll, noRestrictedSyntaxCommonLib, requireEslintTool, resolveEslintTool, -} from './tools/eslint.config_utils.mjs'; +} from './tools/eslint/eslint.config_utils.mjs'; +import nodeCore from './tools/eslint/eslint-plugin-node-core.js'; const js = requireEslintTool('@eslint/js'); const babelEslintParser = requireEslintTool('@babel/eslint-parser'); @@ -20,7 +21,6 @@ const jsdoc = requireEslintTool('eslint-plugin-jsdoc'); const markdown = requireEslintTool('eslint-plugin-markdown'); const stylisticJs = requireEslintTool('@stylistic/eslint-plugin-js'); -const nodeCore = requireEslintTool('eslint-plugin-node-core'); nodeCore.RULES_DIR = fileURLToPath(new URL('./tools/eslint-rules', import.meta.url)); // The Module._resolveFilename() monkeypatching is to make it so that ESLint is able to diff --git a/lib/eslint.config_partial.mjs b/lib/eslint.config_partial.mjs index 3efc32412d0..6e9f5df25ba 100644 --- a/lib/eslint.config_partial.mjs +++ b/lib/eslint.config_partial.mjs @@ -3,7 +3,7 @@ import { noRestrictedSyntaxCommonAll, noRestrictedSyntaxCommonLib, -} from '../tools/eslint.config_utils.mjs'; +} from '../tools/eslint/eslint.config_utils.mjs'; export default [ { diff --git a/test/eslint.config_partial.mjs b/test/eslint.config_partial.mjs index f5dd9f8f2c0..8d9693d8872 100644 --- a/test/eslint.config_partial.mjs +++ b/test/eslint.config_partial.mjs @@ -3,7 +3,7 @@ import { noRestrictedSyntaxCommonAll, requireEslintTool, -} from '../tools/eslint.config_utils.mjs'; +} from '../tools/eslint/eslint.config_utils.mjs'; const globals = requireEslintTool('globals'); diff --git a/tools/node_modules/eslint-plugin-node-core/index.js b/tools/eslint/eslint-plugin-node-core.js similarity index 89% rename from tools/node_modules/eslint-plugin-node-core/index.js rename to tools/eslint/eslint-plugin-node-core.js index e27945688ee..4d4d2809665 100644 --- a/tools/node_modules/eslint-plugin-node-core/index.js +++ b/tools/eslint/eslint-plugin-node-core.js @@ -13,7 +13,7 @@ module.exports = { if (!cache) { cache = {}; const files = fs.readdirSync(RULES_DIR) - .filter(filename => filename.endsWith('.js')) + .filter((filename) => filename.endsWith('.js')); for (const file of files) { const name = file.slice(0, -3); cache[name] = require(path.resolve(RULES_DIR, file)); diff --git a/tools/eslint.config_partial.mjs b/tools/eslint/eslint.config_partial.mjs similarity index 100% rename from tools/eslint.config_partial.mjs rename to tools/eslint/eslint.config_partial.mjs diff --git a/tools/eslint.config_utils.mjs b/tools/eslint/eslint.config_utils.mjs similarity index 89% rename from tools/eslint.config_utils.mjs rename to tools/eslint/eslint.config_utils.mjs index aab2cac4c32..8bec18d6631 100644 --- a/tools/eslint.config_utils.mjs +++ b/tools/eslint/eslint.config_utils.mjs @@ -1,6 +1,6 @@ import { createRequire } from 'node:module'; -export const requireEslintTool = createRequire(new URL('./node_modules/eslint/', import.meta.url)); +export const requireEslintTool = createRequire(new URL('../node_modules/eslint/', import.meta.url)); export const resolveEslintTool = (request) => requireEslintTool.resolve(request); export const noRestrictedSyntaxCommonAll = [