Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds an E2E test for TypeScript ESLint #669

Merged
merged 5 commits into from
Jan 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/e2e-eslint-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,18 @@ jobs:

echo '42' | tee ko.js
! yarn eslint ko.js

- name: 'Running the TypeScript integration test'
run: |
source scripts/e2e-setup-ci.sh

yarn init -p
yarn add eslint typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin

echo '{"parser": "@typescript-eslint/parser", "plugins": ["@typescript-eslint"], "rules": {"@typescript-eslint/explicit-function-return-type": "error"}}' > .eslintrc

echo 'const f = (): number => 42;' | tee ok.ts
yarn eslint ok.ts

echo 'const f = () => 42;' | tee ko.ts
! yarn eslint ko.ts
11 changes: 1 addition & 10 deletions .github/workflows/e2e-typescript-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,14 @@ jobs:
- name: 'Build the standard bundle'
run: |
node ./scripts/run-yarn.js build:cli
node ./scripts/run-yarn workspace @yarnpkg/fslib pack
node ./scripts/run-yarn workspace @yarnpkg/libzip pack
node ./scripts/run-yarn workspace @yarnpkg/pnpify pack

- name: 'Running the integration test'
run: |
source scripts/e2e-setup-ci.sh

yarn init -p
yarn add typescript

jq '.resolutions["@yarnpkg/fslib"] = "file:'"$GITHUB_WORKSPACE"'/packages/yarnpkg-fslib/package.tgz"' <<< "$(cat package.json)" > package.json
jq '.resolutions["@yarnpkg/libzip"] = "file:'"$GITHUB_WORKSPACE"'/packages/yarnpkg-libzip/package.tgz"' <<< "$(cat package.json)" > package.json
jq '.resolutions["@yarnpkg/pnpify"] = "file:'"$GITHUB_WORKSPACE"'/packages/yarnpkg-pnpify/package.tgz"' <<< "$(cat package.json)" > package.json

jq '.scripts.tsc = "pnpify tsc"' <<< "$(cat package.json)" > package.json

yarn add typescript @yarnpkg/pnpify@*
yarn add ts-pnp left-pad @types/left-pad

echo '{"compilerOptions": {"baseUrl": ".", "strict": true, "esModuleInterop": true}}' > tsconfig.json
Expand Down