Skip to content

Commit 2e8750a

Browse files
lpincaRafaelGSS
authored andcommitted
tools: make update-eslint.sh work with npm@9
Make the `update-eslint.sh` script work with `npm@9`. PR-URL: #46088 Refs: https://github.com/nodejs/node/actions/runs/3814364920/jobs/6488613583#step:3:64 Reviewed-By: Ruy Adorno <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent 1b557bb commit 2e8750a

File tree

1 file changed

+34
-6
lines changed

1 file changed

+34
-6
lines changed

tools/update-eslint.sh

+34-6
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,41 @@ rm -rf node_modules/eslint
2121

2222
"$NODE" "$NPM" init --yes
2323

24-
"$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts eslint
25-
# Uninstall plugins that we want to install so that they are removed from devDependencies.
26-
# Otherwise --production will cause them to be skipped.
27-
(cd node_modules/eslint && "$NODE" "$NPM" uninstall --ignore-scripts eslint-plugin-jsdoc eslint-plugin-markdown @babel/core @babel/eslint-parser @babel/plugin-syntax-import-assertions)
28-
(cd node_modules/eslint && "$NODE" "$NPM" install --no-save --no-bin-links --ignore-scripts --production --omit=peer eslint-plugin-jsdoc eslint-plugin-markdown @babel/core @babel/eslint-parser @babel/plugin-syntax-import-assertions)
24+
"$NODE" "$NPM" install \
25+
--ignore-scripts \
26+
--install-strategy=shallow \
27+
--no-bin-links \
28+
eslint
29+
# Uninstall plugins that we want to install so that they are removed from
30+
# devDependencies. Otherwise --omit=dev will cause them to be skipped.
31+
(
32+
cd node_modules/eslint
33+
"$NODE" "$NPM" uninstall \
34+
--install-links=false \
35+
--ignore-scripts \
36+
eslint-plugin-jsdoc \
37+
eslint-plugin-markdown \
38+
@babel/core \
39+
@babel/eslint-parser \
40+
@babel/plugin-syntax-import-assertions
41+
)
42+
(
43+
cd node_modules/eslint
44+
"$NODE" "$NPM" install \
45+
--ignore-scripts \
46+
--install-links=false \
47+
--no-bin-links \
48+
--no-save \
49+
--omit=dev \
50+
--omit=peer \
51+
eslint-plugin-jsdoc \
52+
eslint-plugin-markdown \
53+
@babel/core \
54+
@babel/eslint-parser \
55+
@babel/plugin-syntax-import-assertions
56+
)
2957
# Use dmn to remove some unneeded files.
30-
"$NODE" "$NPM" exec -- [email protected] -f clean
58+
"$NODE" "$NPM" exec --package=[email protected] --yes -- dmn -f clean
3159
# TODO: Get this into dmn.
3260
find node_modules -name .package-lock.json -exec rm {} \;
3361
find node_modules -name 'README*' -exec rm {} \;

0 commit comments

Comments
 (0)