GeezerVison is showing github.com — tools: update ESLint update script to consolidate dependencies · starrify/node@6fd0a60
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/tools.yml -9Lines changed: 0 additions & 9 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
23 | 23 | echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV |
24 | 24 | ./update-eslint.sh |
25 | 25 | fi |
26 | | - - id: "@babel/eslint-parser" |
27 | | - run: | |
28 | | - cd tools |
29 | | - NEW_VERSION=$(npm view @babel/eslint-parser dist-tags.latest) |
30 | | - CURRENT_VERSION=$(node -p "require('./node_modules/@babel/eslint-parser/package.json').version") |
31 | | - if [ "$NEW_VERSION" != "$CURRENT_VERSION" ]; then |
32 | | - echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV |
33 | | - ./update-babel-eslint.sh |
34 | | - fi |
35 | 26 | - id: "lint-md-dependencies" |
36 | 27 | run: | |
37 | 28 | cd tools/lint-md |
|
Collapse file
Copy file name to clipboardExpand all lines: tools/update-babel-eslint.sh -31Lines changed: 0 additions & 31 deletions Collapse file
Copy file name to clipboardExpand all lines: tools/update-eslint.sh +6-6Lines changed: 6 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
5 | 5 | # This script must be in the tools directory when it runs because it uses the |
6 | 6 | # script source file path to determine directories to work in. |
7 | 7 |
|
8 | | -set -e |
| 8 | +set -ex |
9 | 9 |
|
10 | 10 | cd "$( dirname "$0" )" || exit |
11 | | -rm -rf node_modules/eslint node_modules/eslint-plugin-markdown |
| 11 | +rm -rf node_modules/eslint |
12 | 12 | ( |
| 13 | + rm -rf eslint-tmp |
13 | 14 | mkdir eslint-tmp |
14 | 15 | cd eslint-tmp || exit |
15 | 16 |
|
16 | 17 | ROOT="$PWD/../.." |
17 | 18 | [ -z "$NODE" ] && NODE="$ROOT/out/Release/node" |
18 | | - [ -x "$NODE" ] || NODE=`command -v node` |
| 19 | + [ -x "$NODE" ] || NODE=$(command -v node) |
19 | 20 | NPM="$ROOT/deps/npm/bin/npm-cli.js" |
20 | 21 |
|
21 | 22 | "$NODE" "$NPM" init --yes |
22 | 23 |
|
23 | | - "$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts --no-package-lock eslint eslint-plugin-markdown |
24 | | - |
| 24 | + "$NODE" "$NPM" install --global-style --no-bin-links --ignore-scripts eslint |
| 25 | + (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) |
25 | 26 | # Use dmn to remove some unneeded files. |
26 | 27 | |
27 | 28 | # Use removeNPMAbsolutePaths to remove unused data in package.json. |
@@ -30,5 +31,4 @@ rm -rf node_modules/eslint node_modules/eslint-plugin-markdown |
30 | 31 | ) |
31 | 32 |
|
32 | 33 | mv eslint-tmp/node_modules/eslint node_modules/eslint |
33 | | -mv eslint-tmp/node_modules/eslint-plugin-markdown node_modules/eslint-plugin-markdown |
34 | 34 | rm -rf eslint-tmp/ |