summaryrefslogtreecommitdiff
path: root/tools/update-eslint.sh
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2017-06-23 20:27:51 -0700
committerRich Trott <rtrott@gmail.com>2017-06-27 06:17:02 -0700
commit1e5e0ce862174b95fcc04d4b9f9ea68c5944bfee (patch)
tree2525a097185e26816ab5a94a664dba293d2330d3 /tools/update-eslint.sh
parentaaee43473b7abc2522d9968a92fb4c819fc7d7b3 (diff)
downloadnode-new-1e5e0ce862174b95fcc04d4b9f9ea68c5944bfee.tar.gz
tools: add script to update ESLint
Provide a bash script for updating ESLint in the project. PR-URL: https://github.com/nodejs/node/pull/13895 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'tools/update-eslint.sh')
-rwxr-xr-xtools/update-eslint.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/update-eslint.sh b/tools/update-eslint.sh
new file mode 100755
index 0000000000..0c9d3758dc
--- /dev/null
+++ b/tools/update-eslint.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+
+# Shell script to update ESLint in the source tree to the latest release.
+
+# Depends on npm and node being in $PATH.
+
+# 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]}" )"
+rm -rf eslint
+mkdir eslint-tmp
+cd eslint-tmp
+
+npm install --global-style --no-binlinks --production eslint@latest
+cd node_modules/eslint
+
+# eslint-plugin-markdown is pinned at 1.0.0-beta.4 until there is a release
+# that fixes https://github.com/eslint/eslint-plugin-markdown/issues/69.
+npm install --no-bin-links --production eslint-plugin-markdown@1.0.0-beta.4
+cd ../..
+
+# Install dmn if it is not in path.
+type -P dmn || npm install -g dmn
+
+# Use dmn to remove some unneeded files.
+dmn -f clean
+
+cd ..
+mv eslint-tmp/node_modules/eslint eslint
+rm -rf eslint-tmp/