From 44996497f1cf28dfeb3d5ad529aabbe6cc754d7b Mon Sep 17 00:00:00 2001 From: Sam Zhou Date: Wed, 15 Jan 2020 15:41:16 +0800 Subject: [PATCH] Adds an E2E test for TypeScript ESLint (#669) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Adds an E2E test for TypeScript ESLint **What's the problem this PR addresses?** #368 - Adding one basic test for ESLint with `typescript-eslint` * Moves the ESLint-TS workflow in the ESLint workflow * Updates the workflows * Resetup E2E for typescript-eslint integration test Co-authored-by: Maƫl Nison --- .github/workflows/e2e-eslint-workflow.yml | 15 +++++++++++++++ .github/workflows/e2e-typescript-workflow.yml | 11 +---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/e2e-eslint-workflow.yml b/.github/workflows/e2e-eslint-workflow.yml index 445e56699961..818e144ca2d3 100644 --- a/.github/workflows/e2e-eslint-workflow.yml +++ b/.github/workflows/e2e-eslint-workflow.yml @@ -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 diff --git a/.github/workflows/e2e-typescript-workflow.yml b/.github/workflows/e2e-typescript-workflow.yml index f1cee3a95c1c..5a92b313a991 100644 --- a/.github/workflows/e2e-typescript-workflow.yml +++ b/.github/workflows/e2e-typescript-workflow.yml @@ -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