Skip to content
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
Prev Previous commit
Next Next commit
tools: update ESLint update script to consolidate dependencies
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 committed Nov 29, 2021
commit 6fd0a60d6078f5e409077c4ca5856e939922308b
9 changes: 0 additions & 9 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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/