Skip to content

Commit ae79c7f

Browse files
committed
tools: add script to update ESLint
Provide a bash script for updating ESLint in the project. PR-URL: nodejs#13895 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 4934672 commit ae79c7f

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

tools/update-eslint.sh

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
3+
# Shell script to update ESLint in the source tree to the latest release.
4+
5+
# Depends on npm and node being in $PATH.
6+
7+
# This script must be be in the tools directory when it runs because it uses
8+
# $BASH_SOURCE[0] to determine directories to work in.
9+
10+
cd "$( dirname "${BASH_SOURCE[0]}" )"
11+
rm -rf eslint
12+
mkdir eslint-tmp
13+
cd eslint-tmp
14+
15+
npm install --global-style --no-binlinks --production eslint@latest
16+
cd node_modules/eslint
17+
18+
# eslint-plugin-markdown is pinned at 1.0.0-beta.4 until there is a release
19+
# that fixes https://github.com/eslint/eslint-plugin-markdown/issues/69.
20+
npm install --no-bin-links --production [email protected]
21+
cd ../..
22+
23+
# Install dmn if it is not in path.
24+
type -P dmn || npm install -g dmn
25+
26+
# Use dmn to remove some unneeded files.
27+
dmn -f clean
28+
29+
cd ..
30+
mv eslint-tmp/node_modules/eslint eslint
31+
rm -rf eslint-tmp/

0 commit comments

Comments
 (0)