forked from import-js/eslint-plugin-import
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Tests] test on TS parser v2, v3, and v4
- Loading branch information
Showing
3 changed files
with
14 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,16 @@ export NPM_CONFIG_LEGACY_PEER_DEPS=true | |
|
||
npm install --no-save "eslint@${ESLINT_VERSION}" --ignore-scripts | ||
|
||
# completely remove the new TypeScript parser for ESLint < v5 | ||
if [[ "$ESLINT_VERSION" -lt "5" ]]; then | ||
|
||
|
||
if [[ -n "$TS_PARSER" ]]; then # if TS parser is manually set, always use it | ||
echo "Downgrading @typescript-eslint/parser..." | ||
npm i --no-save "@typescript-eslint/parser@${TS_PARSER}" | ||
elif [[ "$ESLINT_VERSION" -lt "5" ]]; then # completely remove the new TypeScript parser for ESLint < v5 | ||
echo "Removing @typescript-eslint/parser..." | ||
npm uninstall --no-save @typescript-eslint/parser | ||
elif [[ "$TRAVIS_NODE_VERSION" -lt "10" ]]; then # TS parser 3 requires node 10+ | ||
npm i --no-save "@typescript-eslint/parser@3" | ||
fi | ||
|
||
# use these alternate TypeScript dependencies for ESLint < v4 | ||
|
@@ -28,8 +34,3 @@ if [[ "$TRAVIS_NODE_VERSION" -lt "8" ]]; then | |
echo "Downgrading eslint-import-resolver-typescript..." | ||
npm i --no-save [email protected] | ||
fi | ||
|
||
if [[ -n "$TS_PARSER" ]]; then | ||
echo "Downgrading @typescript-eslint/parser..." | ||
npm i --no-save @typescript-eslint/parser@2 | ||
fi |