tools: move eslint from tools to tools/node_modules

This is required because we need to add the babel-eslint dependency
and it has to be able to resolve "eslint".
babel-eslint is required to support future ES features such as async
iterators and import.meta.

Refs: https://github.com/nodejs/node/pull/17755
PR-URL: https://github.com/nodejs/node/pull/17820
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
Michaël Zasso 2017-12-22 16:53:42 +01:00
parent a2c7085dd4
commit 3dc3063275
2582 changed files with 72 additions and 71 deletions

View File

@ -36,5 +36,5 @@ end_of_line = ignore
trim_trailing_whitespace = ignore
charset = ignore
[{test/fixtures,deps,tools/eslint,tools/gyp,tools/icu,tools/msvs}/**]
[{test/fixtures,deps,tools/node_modules,tools/gyp,tools/icu,tools/msvs}/**]
insert_final_newline = false

View File

@ -5,7 +5,7 @@ test/addons/??_*
test/es-module/test-esm-dynamic-import.js
test/fixtures
test/message/esm_display_syntax_error.mjs
tools/eslint
tools/node_modules
tools/icu
tools/remark-*
node_modules

2
.gitignore vendored
View File

@ -2,7 +2,7 @@
.*
!deps/**/.*
!test/fixtures/**/.*
!tools/eslint/**/.*
!tools/node_modules/**/.*
!tools/doc/node_modules/**/.*
!.editorconfig
!.eslintignore

View File

@ -1061,7 +1061,7 @@ The externally maintained libraries used by Node.js are:
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""
- ESLint, located at tools/eslint, is licensed as follows:
- ESLint, located at tools/node_modules/eslint, is licensed as follows:
"""
Copyright JS Foundation and other contributors, https://js.foundation

View File

@ -914,7 +914,7 @@ $(TARBALL): release-only $(NODE_EXE) doc
$(RM) -r $(TARNAME)/deps/openssl/openssl/{doc,demos,test}
$(RM) -r $(TARNAME)/deps/zlib/contrib # too big, unused
$(RM) -r $(TARNAME)/.{editorconfig,git*,mailmap}
$(RM) -r $(TARNAME)/tools/{eslint,eslint-rules,osx-pkg.pmdoc,pkgsrc,remark-cli,remark-preset-lint-node}
$(RM) -r $(TARNAME)/tools/{eslint-rules,node_modules,osx-pkg.pmdoc,pkgsrc,remark-cli,remark-preset-lint-node}
$(RM) -r $(TARNAME)/tools/{osx-*,license-builder.sh,cpplint.py}
$(RM) -r $(TARNAME)/test*.tap
find $(TARNAME)/ -name ".eslint*" -maxdepth 2 | xargs $(RM)
@ -1116,7 +1116,7 @@ lint-md:
endif
LINT_JS_TARGETS = benchmark doc lib test tools
LINT_JS_CMD = tools/eslint/bin/eslint.js --cache \
LINT_JS_CMD = tools/node_modules/eslint/bin/eslint.js --cache \
--rulesdir=tools/eslint-rules --ext=.js,.mjs,.md \
$(LINT_JS_TARGETS)
@ -1207,7 +1207,7 @@ cpplint: lint-cpp
.PHONY: lint
.PHONY: lint-ci
ifneq ("","$(wildcard tools/eslint/)")
ifneq ("","$(wildcard tools/node_modules/eslint/)")
lint: ## Run JS, C++, MD and doc linters.
@EXIT_STATUS=0 ; \
$(MAKE) lint-js || EXIT_STATUS=$$? ; \

View File

@ -2,45 +2,45 @@
## Who to CC in issues
| Subsystem | Maintainers |
| --- | --- |
| `benchmark/*` | @nodejs/benchmarking, @mscdex |
| `bootstrap_node.js` | @fishrock123 |
| `doc/*`, `*.md` | @nodejs/documentation |
| `lib/assert` | @nodejs/testing |
| `lib/async_hooks` | @nodejs/async\_hooks for bugs/reviews (+ @nodejs/diagnostics for API) |
| `lib/buffer` | @nodejs/buffer |
| `lib/child_process` | @bnoordhuis, @cjihrig |
| `lib/cluster` | @bnoordhuis, @cjihrig, @mcollina |
| `lib/{crypto,tls,https}` | @nodejs/crypto |
| `lib/dgram` | @cjihrig, @mcollina |
| `lib/domains` | @misterdjules |
| `lib/fs`, `src/{fs,file}` | @nodejs/fs |
| `lib/{_}http{*}` | @nodejs/http |
| `lib/inspector.js`, `src/inspector_*` | @nodejs/v8-inspector |
| `lib/internal/url`, `src/node_url` | @nodejs/url |
| `lib/net` | @bnoordhuis, @indutny, @nodejs/streams |
| `lib/repl` | @addaleax, @fishrock123 |
| `lib/{_}stream{*}` | @nodejs/streams |
| `lib/timers` | @fishrock123, @misterdjules |
| `lib/util` | @bnoordhuis, @cjihrig, @evanlucas |
| `lib/zlib` | @addaleax, @bnoordhuis, @indutny |
| `src/async-wrap.*` | @nodejs/async\_hooks |
| `src/node_api.*` | @nodejs/n-api |
| `src/node_crypto.*` | @nodejs/crypto |
| `test/*` | @nodejs/testing |
| `tools/eslint`, `.eslintrc` | @not-an-aardvark, @silverwind, @trott |
| build | @nodejs/build |
| ES Modules | @bmeck, @Fishrock123, @guybedford, @MylesBorins, @targos |
| GYP | @nodejs/gyp |
| performance | @nodejs/performance |
| platform specific | @nodejs/platform-{aix,arm,freebsd,macos,ppc,smartos,s390,windows} |
| python code | @nodejs/python |
| upgrading c-ares | @jbergstroem |
| upgrading http-parser | @jbergstroem, @nodejs/http |
| upgrading libuv | @saghul |
| upgrading npm | @fishrock123, @MylesBorins |
| upgrading V8 | @nodejs/v8, @nodejs/post-mortem |
| Subsystem | Maintainers |
| --- | --- |
| `benchmark/*` | @nodejs/benchmarking, @mscdex |
| `bootstrap_node.js` | @fishrock123 |
| `doc/*`, `*.md` | @nodejs/documentation |
| `lib/assert` | @nodejs/testing |
| `lib/async_hooks` | @nodejs/async\_hooks for bugs/reviews (+ @nodejs/diagnostics for API) |
| `lib/buffer` | @nodejs/buffer |
| `lib/child_process` | @bnoordhuis, @cjihrig |
| `lib/cluster` | @bnoordhuis, @cjihrig, @mcollina |
| `lib/{crypto,tls,https}` | @nodejs/crypto |
| `lib/dgram` | @cjihrig, @mcollina |
| `lib/domains` | @misterdjules |
| `lib/fs`, `src/{fs,file}` | @nodejs/fs |
| `lib/{_}http{*}` | @nodejs/http |
| `lib/inspector.js`, `src/inspector_*` | @nodejs/v8-inspector |
| `lib/internal/url`, `src/node_url` | @nodejs/url |
| `lib/net` | @bnoordhuis, @indutny, @nodejs/streams |
| `lib/repl` | @addaleax, @fishrock123 |
| `lib/{_}stream{*}` | @nodejs/streams |
| `lib/timers` | @fishrock123, @misterdjules |
| `lib/util` | @bnoordhuis, @cjihrig, @evanlucas |
| `lib/zlib` | @addaleax, @bnoordhuis, @indutny |
| `src/async-wrap.*` | @nodejs/async\_hooks |
| `src/node_api.*` | @nodejs/n-api |
| `src/node_crypto.*` | @nodejs/crypto |
| `test/*` | @nodejs/testing |
| `tools/node_modules/eslint`, `.eslintrc` | @not-an-aardvark, @silverwind, @trott |
| build | @nodejs/build |
| ES Modules | @bmeck, @Fishrock123, @guybedford, @MylesBorins, @targos |
| GYP | @nodejs/gyp |
| performance | @nodejs/performance |
| platform specific | @nodejs/platform-{aix,arm,freebsd,macos,ppc,smartos,s390,windows} |
| python code | @nodejs/python |
| upgrading c-ares | @jbergstroem |
| upgrading http-parser | @jbergstroem, @nodejs/http |
| upgrading libuv | @saghul |
| upgrading npm | @fishrock123, @MylesBorins |
| upgrading V8 | @nodejs/v8, @nodejs/post-mortem |
When things need extra attention, are controversial, or `semver-major`:
@nodejs/tsc

View File

@ -1,9 +1,9 @@
'use strict';
const common = require('../common');
// The doctool currently uses js-yaml from the tool/eslint/ tree.
// The doctool currently uses js-yaml from the tool/node_modules/eslint/ tree.
try {
require('../../tools/eslint/node_modules/js-yaml');
require('../../tools/node_modules/eslint/node_modules/js-yaml');
} catch (e) {
common.skip('missing js-yaml (eslint not present)');
}

View File

@ -2,7 +2,7 @@
require('../common');
const RuleTester = require('../../tools/eslint').RuleTester;
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
const rule = require('../../tools/eslint-rules/alphabetize-errors');
new RuleTester().run('alphabetize-errors', rule, {

View File

@ -2,7 +2,7 @@
require('../common');
const RuleTester = require('../../tools/eslint').RuleTester;
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
const rule = require('../../tools/eslint-rules/buffer-constructor');
const message = 'Use of the Buffer() constructor has been deprecated. ' +

View File

@ -2,7 +2,7 @@
require('../common');
const RuleTester = require('../../tools/eslint').RuleTester;
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
const rule = require('../../tools/eslint-rules/crypto-check');
const message = 'Please add a hasCrypto check to allow this test to be ' +

View File

@ -2,7 +2,7 @@
require('../common');
const RuleTester = require('../../tools/eslint').RuleTester;
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
const rule = require('../../tools/eslint-rules/documented-errors');
const invalidCode = 'UNDOCUMENTED ERROR CODE';

View File

@ -2,7 +2,7 @@
require('../common');
const RuleTester = require('../../tools/eslint').RuleTester;
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
const rule = require('../../tools/eslint-rules/inspector-check');
const message = 'Please add a skipIfInspectorDisabled() call to allow this ' +

View File

@ -2,7 +2,7 @@
require('../common');
const RuleTester = require('../../tools/eslint').RuleTester;
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
const rule = require('../../tools/eslint-rules/lowercase-name-for-primitive');
const valid = [

View File

@ -2,7 +2,7 @@
require('../common');
const RuleTester = require('../../tools/eslint').RuleTester;
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
const rule = require('../../tools/eslint-rules/no-let-in-for-declaration');
const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 6 } });

View File

@ -2,7 +2,7 @@
require('../common');
const RuleTester = require('../../tools/eslint').RuleTester;
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
const rule = require('../../tools/eslint-rules/no-unescaped-regexp-dot');
new RuleTester().run('no-unescaped-regexp-dot', rule, {

View File

@ -2,7 +2,7 @@
require('../common');
const RuleTester = require('../../tools/eslint').RuleTester;
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
const rule = require('../../tools/eslint-rules/number-isnan');
const message = 'Please use Number.isNaN instead of the global isNaN function';

View File

@ -2,7 +2,7 @@
require('../common');
const RuleTester = require('../../tools/eslint').RuleTester;
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
const rule = require('../../tools/eslint-rules/prefer-assert-iferror');
new RuleTester().run('prefer-assert-iferror', rule, {

View File

@ -2,7 +2,7 @@
require('../common');
const RuleTester = require('../../tools/eslint').RuleTester;
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
const rule = require('../../tools/eslint-rules/prefer-assert-methods');
new RuleTester().run('prefer-assert-methods', rule, {

View File

@ -2,7 +2,7 @@
require('../common');
const RuleTester = require('../../tools/eslint').RuleTester;
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
const rule = require('../../tools/eslint-rules/prefer-common-expectserror');
const message = 'Please use common.expectsError(fn, err) instead of ' +

View File

@ -2,7 +2,7 @@
require('../common');
const RuleTester = require('../../tools/eslint').RuleTester;
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
const rule = require('../../tools/eslint-rules/prefer-common-mustnotcall');
const message = 'Please use common.mustNotCall(msg) instead of ' +

View File

@ -4,7 +4,7 @@
require('../common');
const RuleTester = require('../../tools/eslint').RuleTester;
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
const rule = require('../../tools/eslint-rules/prefer-util-format-errors');
new RuleTester({ parserOptions: { ecmaVersion: 6 } })

View File

@ -2,7 +2,7 @@
require('../common');
const RuleTester = require('../../tools/eslint').RuleTester;
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
const rule = require('../../tools/eslint-rules/require-buffer');
const ruleTester = new RuleTester({
parserOptions: { ecmaVersion: 6 },

View File

@ -2,7 +2,7 @@
require('../common');
const RuleTester = require('../../tools/eslint').RuleTester;
const RuleTester = require('../../tools/node_modules/eslint').RuleTester;
const rule = require('../../tools/eslint-rules/required-modules');
new RuleTester().run('required-modules', rule, {

View File

@ -7,6 +7,7 @@ const path = require('path');
const realJSYaml = path.resolve(
__dirname, '..', '..', '..', // tools/
'node_modules',
'eslint',
'node_modules',
'js-yaml'

View File

@ -77,7 +77,7 @@ addlicense "marked" "tools/doc/node_modules/marked" \
# Testing tools
addlicense "cpplint.py" "tools/cpplint.py" \
"$(sed -e '/^$/,$d' -e 's/^#$//' -e 's/^# //' ${rootdir}/tools/cpplint.py | tail -n +3)"
addlicense "ESLint" "tools/eslint" "$(cat ${rootdir}/tools/eslint/LICENSE)"
addlicense "ESLint" "tools/node_modules/eslint" "$(cat ${rootdir}/tools/node_modules/eslint/LICENSE)"
addlicense "gtest" "deps/gtest" "$(cat ${rootdir}/deps/gtest/LICENSE)"
# nghttp2

View File

@ -10,8 +10,8 @@ const path = require('path');
const fs = require('fs');
const totalCPUs = require('os').cpus().length;
const CLIEngine = require('./eslint').CLIEngine;
const glob = require('./eslint/node_modules/glob');
const CLIEngine = require('eslint').CLIEngine;
const glob = require('eslint/node_modules/glob');
const cliOptions = {
rulePaths: rulesDirs,

Some files were not shown because too many files have changed in this diff Show More