Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: don't store eslint locally #53974

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ updates:
commit-message:
prefix: meta
open-pull-requests-limit: 10

- package-ecosystem: npm
directory: /tools/eslint
schedule:
interval: monthly
commit-message:
prefix: tools
open-pull-requests-limit: 10
9 changes: 0 additions & 9 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ on:
- cjs-module-lexer
- corepack
- doc
- eslint
- github_reporter
- googletest
- gyp-next
Expand Down Expand Up @@ -128,14 +127,6 @@ jobs:
npm install --ignore-scripts $NEW_VERSION
npm install --ignore-scripts
fi
- id: eslint
subsystem: tools
label: tools
run: |
./tools/dep_updaters/update-eslint.sh > temp-output
cat temp-output
tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true
rm temp-output
- id: github_reporter
subsystem: tools
label: tools
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ tools/*/*.i.tmp
/node_modules
/tools/doc/node_modules
/tools/clang-format/node_modules
/tools/eslint/node_modules

# === Rules for test artifacts ===
/*.tap
Expand Down
23 changes: 0 additions & 23 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -2003,29 +2003,6 @@ 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/node_modules/eslint, is licensed as follows:
"""
Copyright OpenJS Foundation and other contributors, <www.openjsf.org>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
"""

- gtest, located at deps/googletest, is licensed as follows:
"""
Copyright 2008, Google Inc.
Expand Down
19 changes: 12 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,6 @@ $(TARBALL): release-only doc-only
$(RM) -r $(TARNAME)/tools/eslint
$(RM) -r $(TARNAME)/tools/eslint-rules
$(RM) -r $(TARNAME)/tools/license-builder.sh
$(RM) -r $(TARNAME)/tools/eslint/node_modules
$(RM) -r $(TARNAME)/tools/osx-*
$(RM) -r $(TARNAME)/tools/osx-pkg.pmdoc
find $(TARNAME)/deps/v8/test/* -type d ! -regex '.*/test/torque$$' | xargs $(RM) -r
Expand Down Expand Up @@ -1384,15 +1383,20 @@ run-lint-js = tools/eslint/node_modules/eslint/bin/eslint.js --cache \
run-lint-js-fix = $(run-lint-js) --fix

.PHONY: lint-js-fix
lint-js-fix:
@$(call available-node,$(run-lint-js-fix))

.PHONY: lint-js
.PHONY: lint-js-doc
.PHONY: lint-js-build

lint-js-build:
cd tools/eslint && $(call available-node,$(run-npm-ci))
RedYetiDev marked this conversation as resolved.
Show resolved Hide resolved

lint-js-fix: lint-js-build
@$(call available-node,$(run-lint-js-fix))

# Note that on the CI `lint-js-ci` is run instead.
# Lints the JavaScript code with eslint.
lint-js-doc: LINT_JS_TARGETS=doc
lint-js lint-js-doc:
lint-js lint-js-doc: lint-js-build
@if [ "$(shell $(node_use_openssl))" != "true" ]; then \
echo "Skipping $@ (no crypto)"; \
else \
Expand All @@ -1409,7 +1413,7 @@ run-lint-js-ci = tools/eslint/node_modules/eslint/bin/eslint.js \

.PHONY: lint-js-ci
# On the CI the output is emitted in the TAP format.
lint-js-ci:
lint-js-ci: lint-js-build
$(info Running JS linter...)
@$(call available-node,$(run-lint-js-ci))

Expand Down Expand Up @@ -1563,7 +1567,7 @@ lint-yaml:

.PHONY: lint
.PHONY: lint-ci
ifneq ("","$(wildcard tools/eslint/node_modules/eslint/)")
ifneq ("","$(wildcard tools/eslint/)")
lint: ## Run JS, C++, MD and doc linters.
@EXIT_STATUS=0 ; \
$(MAKE) lint-js || EXIT_STATUS=$$? ; \
Expand Down Expand Up @@ -1594,6 +1598,7 @@ endif
lint-clean:
$(RM) tools/.*lintstamp
$(RM) .eslintcache
$(RM) tools/eslint/node_modules
RedYetiDev marked this conversation as resolved.
Show resolved Hide resolved

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

Expand Down
49 changes: 0 additions & 49 deletions tools/dep_updaters/update-eslint.sh

This file was deleted.

66 changes: 33 additions & 33 deletions tools/eslint/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions tools/license-builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ licenseText="$(sed -e '/^$/,$d' -e 's/^#$//' -e 's/^# //' "${rootdir}/tools/cppl
addlicense "cpplint.py" "tools/cpplint.py" "$licenseText"
licenseText="$(sed -e '/^$/,$d' -e 's/^#$//' -e 's/^# //' "${rootdir}/tools/gypi_to_gn.py" | tail -n +3)"
addlicense "gypi_to_gn.py" "tools/gypi_to_gn.py" "$licenseText"
licenseText="$(cat "${rootdir}/tools/eslint/node_modules/eslint/LICENSE")"
addlicense "ESLint" "tools/eslint/node_modules/eslint" "$licenseText"
licenseText="$(cat "${rootdir}/deps/googletest/LICENSE")"
addlicense "gtest" "deps/googletest" "$licenseText"

Expand Down
9 changes: 9 additions & 0 deletions vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ set msi=
set upload=
set licensertf=
set lint_js=
set lint_js_build=
set lint_cpp=
set lint_md=
set lint_md_build=
Expand Down Expand Up @@ -115,6 +116,7 @@ if /i "%1"=="test-v8-benchmarks" set test_v8_benchmarks=1&set custom_v8_test=1&g
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
if /i "%1"=="lint-cpp" set lint_cpp=1&goto arg-ok
if /i "%1"=="lint-js" set lint_js=1&goto arg-ok
if /i "%1"=="lint-js-build" set lint_js_build=1&goto arg-ok
if /i "%1"=="jslint" set lint_js=1&echo Please use lint-js instead of jslint&goto arg-ok
if /i "%1"=="lint-md" set lint_md=1&goto arg-ok
if /i "%1"=="lint-md-build" set lint_md_build=1&goto arg-ok
Expand Down Expand Up @@ -719,6 +721,13 @@ goto lint-js

:run-make-lint
%NODEJS_MAKE% lint-cpp
goto lint-js-build

:lint-js-build
if not defined lint_js_build if not defined lint_js goto lint-md-build
cd tools\eslint
%npm_exe% ci
cd ..\..
goto lint-js

:lint-js
Expand Down
Loading