Skip to content

Commit 86d5af1

Browse files
Trottdanielleadams
authored andcommitted
tools: update ESLint update script to consolidate dependencies
PR-URL: #40995 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 8427099 commit 86d5af1

File tree

3 files changed

+6
-46
lines changed

3 files changed

+6
-46
lines changed

.github/workflows/tools.yml

-9
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@ jobs:
2323
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
2424
./update-eslint.sh
2525
fi
26-
- id: "@babel/eslint-parser"
27-
run: |
28-
cd tools
29-
NEW_VERSION=$(npm view @babel/eslint-parser dist-tags.latest)
30-
CURRENT_VERSION=$(node -p "require('./node_modules/@babel/eslint-parser/package.json').version")
31-
if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then
32-
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
33-
./update-babel-eslint.sh
34-
fi
3526
- id: "lint-md-dependencies"
3627
run: |
3728
cd tools/lint-md

tools/update-babel-eslint.sh

-31
This file was deleted.

tools/update-eslint.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,24 @@
55
# This script must be in the tools directory when it runs because it uses the
66
# script source file path to determine directories to work in.
77

8-
set -e
8+
set -ex
99

1010
cd "$( dirname "$0" )" || exit
11-
rm -rf node_modules/eslint node_modules/eslint-plugin-markdown
11+
rm -rf node_modules/eslint
1212
(
13+
rm -rf eslint-tmp
1314
mkdir eslint-tmp
1415
cd eslint-tmp || exit
1516

1617
ROOT="$PWD/../.."
1718
[ -z "$NODE" ] && NODE="$ROOT/out/Release/node"
18-
[ -x "$NODE" ] || NODE=`command -v node`
19+
[ -x "$NODE" ] || NODE=$(command -v node)
1920
NPM="$ROOT/deps/npm/bin/npm-cli.js"
2021

2122
"$NODE" "$NPM" init --yes
2223

23-
"$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts --no-package-lock eslint eslint-plugin-markdown
24-
24+
"$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts eslint
25+
(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)
2526
# Use dmn to remove some unneeded files.
2627
"$NODE" "$NPM" exec -- [email protected] -f clean
2728
# Use removeNPMAbsolutePaths to remove unused data in package.json.
@@ -30,5 +31,4 @@ rm -rf node_modules/eslint node_modules/eslint-plugin-markdown
3031
)
3132

3233
mv eslint-tmp/node_modules/eslint node_modules/eslint
33-
mv eslint-tmp/node_modules/eslint-plugin-markdown node_modules/eslint-plugin-markdown
3434
rm -rf eslint-tmp/

0 commit comments

Comments
 (0)