2017-06-24 05:27:51 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Shell script to update ESLint in the source tree to the latest release.
|
|
|
|
|
2018-07-11 07:30:56 +02:00
|
|
|
# Depends on npm, npx, and node being in $PATH.
|
2017-06-24 05:27:51 +02:00
|
|
|
|
|
|
|
# This script must be be in the tools directory when it runs because it uses
|
|
|
|
# $BASH_SOURCE[0] to determine directories to work in.
|
|
|
|
|
|
|
|
cd "$( dirname "${BASH_SOURCE[0]}" )"
|
2017-12-22 16:53:42 +01:00
|
|
|
rm -rf node_modules/eslint
|
2017-06-24 05:27:51 +02:00
|
|
|
mkdir eslint-tmp
|
|
|
|
cd eslint-tmp
|
2017-08-16 09:03:45 +02:00
|
|
|
npm init --yes
|
2017-06-24 05:27:51 +02:00
|
|
|
|
2019-06-11 15:38:07 +02:00
|
|
|
npm install --global-style --no-bin-links --production --no-package-lock eslint@latest
|
2017-06-24 05:27:51 +02:00
|
|
|
cd node_modules/eslint
|
|
|
|
|
2019-02-28 07:29:45 +01:00
|
|
|
npm install --no-bin-links --production --no-package-lock eslint-plugin-markdown@latest
|
2017-06-24 05:27:51 +02:00
|
|
|
cd ../..
|
|
|
|
|
|
|
|
# Use dmn to remove some unneeded files.
|
2019-05-14 04:47:24 +02:00
|
|
|
npx dmn@2.2.2 -f clean
|
2018-07-15 04:28:53 +02:00
|
|
|
# Use removeNPMAbsolutePaths to remove unused data in package.json.
|
|
|
|
# This avoids churn as absolute paths can change from one dev to another.
|
|
|
|
npx removeNPMAbsolutePaths@1.0.4 .
|
2017-06-24 05:27:51 +02:00
|
|
|
|
|
|
|
cd ..
|
2017-12-22 16:53:42 +01:00
|
|
|
mv eslint-tmp/node_modules/eslint node_modules/eslint
|
2017-06-24 05:27:51 +02:00
|
|
|
rm -rf eslint-tmp/
|