Skip to content

Commit

Permalink
tools: update ESLint update script to consolidate dependencies
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
Trott authored and danielleadams committed Dec 13, 2021
1 parent 953baaa commit 0aa589b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 46 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/tools.yml
Expand Up @@ -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
Expand Down
31 changes: 0 additions & 31 deletions tools/update-babel-eslint.sh

This file was deleted.

12 changes: 6 additions & 6 deletions tools/update-eslint.sh
Expand Up @@ -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.
Expand All @@ -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/

0 comments on commit 0aa589b

Please sign in to comment.