0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/tools/update-eslint.sh
Michaël Zasso 3dc3063275 tools: move eslint from tools to tools/node_modules
This is required because we need to add the babel-eslint dependency
and it has to be able to resolve "eslint".
babel-eslint is required to support future ES features such as async
iterators and import.meta.

Refs: https://github.com/nodejs/node/pull/17755
PR-URL: https://github.com/nodejs/node/pull/17820
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2018-01-11 09:48:05 +01:00

31 lines
796 B
Bash
Executable File

#!/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 node_modules/eslint
mkdir eslint-tmp
cd eslint-tmp
npm init --yes
npm install --global-style --no-bin-links --production --no-package-lock eslint@latest
cd node_modules/eslint
npm install --no-bin-links --production --no-package-lock eslint-plugin-markdown@next
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 node_modules/eslint
rm -rf eslint-tmp/