Skip to content

Commit 1e378c0

Browse files
committed
(review changes)
1 parent 1216ae5 commit 1e378c0

File tree

8 files changed

+25
-93
lines changed

8 files changed

+25
-93
lines changed

.github/dependabot.yml

+8
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,11 @@ updates:
99
commit-message:
1010
prefix: meta
1111
open-pull-requests-limit: 10
12+
13+
- package-ecosystem: npm
14+
directory: /tools/eslint
15+
schedule:
16+
interval: monthly
17+
commit-message:
18+
prefix: tools
19+
open-pull-requests-limit: 10

.github/workflows/tools.yml

-9
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ on:
2222
- cjs-module-lexer
2323
- corepack
2424
- doc
25-
- eslint
2625
- github_reporter
2726
- googletest
2827
- gyp-next
@@ -137,14 +136,6 @@ jobs:
137136
npm install --ignore-scripts $NEW_VERSION
138137
npm install --ignore-scripts
139138
fi
140-
- id: eslint
141-
subsystem: tools
142-
label: tools
143-
run: |
144-
./tools/dep_updaters/update-eslint.sh > temp-output
145-
cat temp-output
146-
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
147-
rm temp-output
148139
- id: github_reporter
149140
subsystem: tools
150141
label: tools

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ tools/*/*.i.tmp
112112
/node_modules
113113
/tools/doc/node_modules
114114
/tools/clang-format/node_modules
115+
/tools/eslint/node_modules
115116

116117
# === Rules for test artifacts ===
117118
/*.tap

LICENSE

-23
Original file line numberDiff line numberDiff line change
@@ -2028,29 +2028,6 @@ The externally maintained libraries used by Node.js are:
20282028
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20292029
"""
20302030

2031-
- ESLint, located at tools/eslint/node_modules/eslint, is licensed as follows:
2032-
"""
2033-
Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
2034-
2035-
Permission is hereby granted, free of charge, to any person obtaining a copy
2036-
of this software and associated documentation files (the "Software"), to deal
2037-
in the Software without restriction, including without limitation the rights
2038-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2039-
copies of the Software, and to permit persons to whom the Software is
2040-
furnished to do so, subject to the following conditions:
2041-
2042-
The above copyright notice and this permission notice shall be included in
2043-
all copies or substantial portions of the Software.
2044-
2045-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2046-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2047-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2048-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2049-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2050-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2051-
THE SOFTWARE.
2052-
"""
2053-
20542031
- gtest, located at deps/googletest, is licensed as follows:
20552032
"""
20562033
Copyright 2008, Google Inc.

Makefile

+7-9
Original file line numberDiff line numberDiff line change
@@ -1384,16 +1384,19 @@ run-lint-js = tools/eslint/node_modules/eslint/bin/eslint.js --cache \
13841384
--max-warnings=0 --report-unused-disable-directives $(LINT_JS_TARGETS)
13851385
run-lint-js-fix = $(run-lint-js) --fix
13861386

1387+
tools/.jslintstamp:
1388+
cd tools/eslint && $(call available-node,$(run-npm-ci))
1389+
13871390
.PHONY: lint-js-fix
1388-
lint-js-fix:
1391+
lint-js-fix: tools/.jslintstamp
13891392
@$(call available-node,$(run-lint-js-fix))
13901393

13911394
.PHONY: lint-js
13921395
.PHONY: lint-js-doc
13931396
# Note that on the CI `lint-js-ci` is run instead.
13941397
# Lints the JavaScript code with eslint.
13951398
lint-js-doc: LINT_JS_TARGETS=doc
1396-
lint-js lint-js-doc:
1399+
lint-js lint-js-doc: tools/.jslintstamp
13971400
@if [ "$(shell $(node_use_openssl))" != "true" ]; then \
13981401
echo "Skipping $@ (no crypto)"; \
13991402
else \
@@ -1410,7 +1413,7 @@ run-lint-js-ci = tools/eslint/node_modules/eslint/bin/eslint.js \
14101413

14111414
.PHONY: lint-js-ci
14121415
# On the CI the output is emitted in the TAP format.
1413-
lint-js-ci:
1416+
lint-js-ci: tools/.jslintstamp
14141417
$(info Running JS linter...)
14151418
@$(call available-node,$(run-lint-js-ci))
14161419

@@ -1564,7 +1567,6 @@ lint-yaml:
15641567

15651568
.PHONY: lint
15661569
.PHONY: lint-ci
1567-
ifneq ("","$(wildcard tools/eslint/node_modules/eslint/)")
15681570
lint: ## Run JS, C++, MD and doc linters.
15691571
@EXIT_STATUS=0 ; \
15701572
$(MAKE) lint-js || EXIT_STATUS=$$? ; \
@@ -1585,16 +1587,12 @@ lint-ci: lint-js-ci lint-cpp lint-py lint-md lint-addon-docs lint-yaml-build lin
15851587
echo "Conflict marker detected in one or more files. Please fix them first." >&2 ; \
15861588
exit 1 ; \
15871589
fi
1588-
else
1589-
lint lint-ci:
1590-
$(info Linting is not available through the source tarball.)
1591-
$(info Use the git repo instead: $$ git clone https://github.com/nodejs/node.git)
1592-
endif
15931590

15941591
.PHONY: lint-clean
15951592
lint-clean:
15961593
$(RM) tools/.*lintstamp
15971594
$(RM) .eslintcache
1595+
$(RM) -r tools/eslint/node_modules
15981596

15991597
HAS_DOCKER ?= $(shell command -v docker > /dev/null 2>&1; [ $$? -eq 0 ] && echo 1 || echo 0)
16001598

tools/dep_updaters/update-eslint.sh

-49
This file was deleted.

tools/license-builder.sh

-2
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ licenseText="$(sed -e '/^$/,$d' -e 's/^#$//' -e 's/^# //' "${rootdir}/tools/cppl
109109
addlicense "cpplint.py" "tools/cpplint.py" "$licenseText"
110110
licenseText="$(sed -e '/^$/,$d' -e 's/^#$//' -e 's/^# //' "${rootdir}/tools/gypi_to_gn.py" | tail -n +3)"
111111
addlicense "gypi_to_gn.py" "tools/gypi_to_gn.py" "$licenseText"
112-
licenseText="$(cat "${rootdir}/tools/eslint/node_modules/eslint/LICENSE")"
113-
addlicense "ESLint" "tools/eslint/node_modules/eslint" "$licenseText"
114112
licenseText="$(cat "${rootdir}/deps/googletest/LICENSE")"
115113
addlicense "gtest" "deps/googletest" "$licenseText"
116114

vcbuild.bat

+9-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ set msi=
4141
set upload=
4242
set licensertf=
4343
set lint_js=
44+
set lint_js_build=
4445
set lint_js_fix=
4546
set lint_cpp=
4647
set lint_md=
@@ -116,6 +117,7 @@ if /i "%1"=="test-v8-benchmarks" set test_v8_benchmarks=1&set custom_v8_test=1&g
116117
if /i "%1"=="test-v8-all" set test_v8=1&set test_v8_intl=1&set test_v8_benchmarks=1&set custom_v8_test=1&goto arg-ok
117118
if /i "%1"=="lint-cpp" set lint_cpp=1&goto arg-ok
118119
if /i "%1"=="lint-js" set lint_js=1&goto arg-ok
120+
if /i "%1"=="lint-js-build" set lint_js_build=1&goto arg-ok
119121
if /i "%1"=="lint-js-fix" set lint_js_fix=1&goto arg-ok
120122
if /i "%1"=="jslint" set lint_js=1&echo Please use lint-js instead of jslint&goto arg-ok
121123
if /i "%1"=="lint-md" set lint_md=1&goto arg-ok
@@ -729,7 +731,13 @@ goto lint-js
729731

730732
:run-make-lint
731733
%NODEJS_MAKE% lint-cpp
732-
goto lint-js
734+
goto lint-js-build
735+
736+
:lint-js-build
737+
if not defined lint_js_build if not defined lint_js if not defined lint_js_fix goto lint-md-build
738+
cd tools\eslint
739+
%npm_exe% ci
740+
cd ..\..
733741

734742
:lint-js
735743
if not defined lint_js goto lint-js-fix

0 commit comments

Comments
 (0)