diff --git a/.eslintrc.js b/.eslintrc.js index 9bd8e661237fd7..623c8f7bd2291d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -8,9 +8,7 @@ NodePlugin.RULES_DIR = path.resolve(__dirname, 'tools', 'eslint-rules'); const ModuleFindPath = Module._findPath; const hacks = [ - 'eslint-plugin-node-core', - 'eslint-plugin-markdown', - 'babel-eslint', + 'eslint-plugin-node-core' ]; Module._findPath = (request, paths, isMain) => { const r = ModuleFindPath(request, paths, isMain); diff --git a/.gitignore b/.gitignore index dad5a3efd8bcae..43e3984290a801 100644 --- a/.gitignore +++ b/.gitignore @@ -135,3 +135,5 @@ deps/v8/gypfiles/Release/ deps/v8/third_party/eu-strip/ .DS_Store +tools/node_modules/* +node_modules/* diff --git a/Makefile b/Makefile index c3c9bdf6f765e4..50229bbe92ed3f 100644 --- a/Makefile +++ b/Makefile @@ -705,6 +705,7 @@ out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets run-npm-ci = $(PWD)/$(NPM) ci +run-npm-task = $(PWD)/$(NPM) run LINK_DATA = out/doc/apilinks.json gen-api = tools/doc/generate.js --node-version=$(FULLVERSION) \ @@ -1172,8 +1173,7 @@ lint-md: | tools/.mdlintstamp LINT_JS_TARGETS = .eslintrc.js benchmark doc lib test tools -run-lint-js = tools/node_modules/eslint/bin/eslint.js --cache \ - --report-unused-disable-directives --ext=.js,.mjs,.md $(LINT_JS_TARGETS) +run-lint-js = $(call available-node,$(run-npm-ci)) && $(call available-node,$(run-npm-task) lint) run-lint-js-fix = $(run-lint-js) --fix .PHONY: lint-js-fix diff --git a/package.json b/package.json new file mode 100644 index 00000000000000..530a14b715d1e6 --- /dev/null +++ b/package.json @@ -0,0 +1,17 @@ +{ + "name": "node-core", + "author": "The Amazing Node.js Contributors", + "version": "1.0.0", + "description": "Base tools to help manage node core", + "license": "MIT", + "scripts": { + "lint": "eslint --cache --report-unused-disable-directives --ext=.js,.mjs,.md .eslintrc.js benchmark doc lib test tools" + }, + "dependencies": { + "babel-eslint": "8.2.1", + "eslint": "5.14.1", + "eslint-plugin-markdown": "1.0.0", + "glob": "7.1.3", + "js-yaml": "3.12.1" + } +} diff --git a/tools/doc/common.js b/tools/doc/common.js index 86daae6cfc6d56..8a5f33731f8335 100644 --- a/tools/doc/common.js +++ b/tools/doc/common.js @@ -1,7 +1,6 @@ 'use strict'; -const yaml = - require(`${__dirname}/../node_modules/eslint/node_modules/js-yaml`); +const yaml = require(`js-yaml`); function isYAMLBlock(text) { return /^