Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2021-11-27 19:20:13 +0300
committerRich Trott <rtrott@gmail.com>2021-11-30 01:52:36 +0300
commit6fd0a60d6078f5e409077c4ca5856e939922308b (patch)
tree23bd6e94ef7ad82d899347d020184bb8786adaab
parent45422db0740d2be10e421e1dd69108e3029d32bc (diff)
tools: update ESLint update script to consolidate dependencies
PR-URL: https://github.com/nodejs/node/pull/40995 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
-rw-r--r--.github/workflows/tools.yml9
-rwxr-xr-xtools/update-babel-eslint.sh31
-rwxr-xr-xtools/update-eslint.sh12
3 files changed, 6 insertions, 46 deletions
diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml
index c5d1d7eb114..d4f7a5d68c8 100644
--- a/.github/workflows/tools.yml
+++ b/.github/workflows/tools.yml
@@ -23,15 +23,6 @@ jobs:
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
./update-eslint.sh
fi
- - id: "@babel/eslint-parser"
- run: |
- cd tools
- NEW_VERSION=$(npm view @babel/eslint-parser dist-tags.latest)
- CURRENT_VERSION=$(node -p "require('./node_modules/@babel/eslint-parser/package.json').version")
- if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
- echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
- ./update-babel-eslint.sh
- fi
- id: "lint-md-dependencies"
run: |
cd tools/lint-md
diff --git a/tools/update-babel-eslint.sh b/tools/update-babel-eslint.sh
deleted file mode 100755
index fa6c0b0ee41..00000000000
--- a/tools/update-babel-eslint.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-# Shell script to update babel-eslint in the source tree to the latest release.
-
-# This script must be be in the tools directory when it runs because it uses
-# $0 to determine directories to work in.
-
-set -e
-
-cd "$( dirname "${0}" )" || exit
-rm -rf node_modules/@babel
-mkdir babel-eslint-tmp
-cd babel-eslint-tmp || exit
-
-ROOT="$PWD/../.."
-[ -z "$NODE" ] && NODE="$ROOT/out/Release/node"
-[ -x "$NODE" ] || NODE=`command -v node`
-NPM="$ROOT/deps/npm/bin/npm-cli.js"
-
-"$NODE" "$NPM" init --yes
-"$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts --no-package-lock @babel/core @babel/eslint-parser @babel/plugin-syntax-import-assertions
-
-# Use dmn to remove some unneeded files.
-"$NODE" "$NPM" exec -- dmn@2.2.2 -f clean
-# Use removeNPMAbsolutePaths to remove unused data in package.json.
-# This avoids churn as absolute paths can change from one dev to another.
-"$NODE" "$NPM" exec -- removeNPMAbsolutePaths@1.0.4 .
-
-cd ..
-mv babel-eslint-tmp/node_modules/@babel node_modules/@babel
-rm -rf babel-eslint-tmp/
diff --git a/tools/update-eslint.sh b/tools/update-eslint.sh
index 5f87680597f..137130148c2 100755
--- a/tools/update-eslint.sh
+++ b/tools/update-eslint.sh
@@ -5,23 +5,24 @@
# This script must be in the tools directory when it runs because it uses the
# script source file path to determine directories to work in.
-set -e
+set -ex
cd "$( dirname "$0" )" || exit
-rm -rf node_modules/eslint node_modules/eslint-plugin-markdown
+rm -rf node_modules/eslint
(
+ rm -rf eslint-tmp
mkdir eslint-tmp
cd eslint-tmp || exit
ROOT="$PWD/../.."
[ -z "$NODE" ] && NODE="$ROOT/out/Release/node"
- [ -x "$NODE" ] || NODE=`command -v node`
+ [ -x "$NODE" ] || NODE=$(command -v node)
NPM="$ROOT/deps/npm/bin/npm-cli.js"
"$NODE" "$NPM" init --yes
- "$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts --no-package-lock eslint eslint-plugin-markdown
-
+ "$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts eslint
+ (cd node_modules/eslint && "$NODE" "$NPM" install --no-bin-links --ignore-scripts --production --omit=peer eslint-plugin-markdown @babel/core @babel/eslint-parser @babel/plugin-syntax-import-assertions)
# Use dmn to remove some unneeded files.
"$NODE" "$NPM" exec -- dmn@2.2.2 -f clean
# Use removeNPMAbsolutePaths to remove unused data in package.json.
@@ -30,5 +31,4 @@ rm -rf node_modules/eslint node_modules/eslint-plugin-markdown
)
mv eslint-tmp/node_modules/eslint node_modules/eslint
-mv eslint-tmp/node_modules/eslint-plugin-markdown node_modules/eslint-plugin-markdown
rm -rf eslint-tmp/