Skip to content

Typescript 5.1 testing #7091

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
16d750f
feat: support TypeScript 5.1
JoshuaKGoldberg Jun 6, 2023
45e19f8
Re-apply patch-package typescript
JoshuaKGoldberg Jun 6, 2023
07a8a85
jsx: preserve in ast-spec
JoshuaKGoldberg Jun 7, 2023
a000e00
Added component-dashed fixture
JoshuaKGoldberg Jun 7, 2023
65ae4f9
Rename to avoid global naming conflict
JoshuaKGoldberg Jun 7, 2023
676e900
chore: only run website tests on non-forks
JamesHenry Jun 7, 2023
8bf3877
chore: only run website tests on non-forks
JamesHenry Jun 7, 2023
16553c6
Updated ast-spec snapshots
JoshuaKGoldberg Jun 7, 2023
4bd4879
Let's try --runInBand
JoshuaKGoldberg Jun 7, 2023
6931b54
How about some logging
JoshuaKGoldberg Jun 7, 2023
ea0e298
--verbose
JoshuaKGoldberg Jun 7, 2023
6a7c991
Skip parse.moduleResolver.+ tests in Node 14
JoshuaKGoldberg Jun 7, 2023
018e10f
map of undefined
JoshuaKGoldberg Jun 8, 2023
50a51ae
more logging on process version
JoshuaKGoldberg Jun 8, 2023
5bfbdac
Remove jest.config.js shenanigans
JoshuaKGoldberg Jun 8, 2023
377d69f
Remove --frozen-lockfile for now
JoshuaKGoldberg Jun 8, 2023
1d0484f
Mention ts version in jest.config.js
JoshuaKGoldberg Jun 8, 2023
f97cf33
Split placeholder-error in twain
JoshuaKGoldberg Jun 8, 2023
0b4eb19
Try a .skip
JoshuaKGoldberg Jun 8, 2023
ad1541d
Revert "Try a .skip"
JoshuaKGoldberg Jun 8, 2023
c6f949b
Heck, let's try Node 20
JoshuaKGoldberg Jun 8, 2023
564f73d
Revert "Heck, let's try Node 20"
JoshuaKGoldberg Jun 8, 2023
b865a7a
testing: specific script for TypeScript 5.1
JoshuaKGoldberg Jun 8, 2023
98926aa
Trim down ci.yml to be easier
JoshuaKGoldberg Jun 8, 2023
063e4da
Just move to ci.yml
JoshuaKGoldberg Jun 8, 2023
7fe0a5e
Easier unit_tests.name
JoshuaKGoldberg Jun 8, 2023
4d8e21c
Added resolution swapper and ci.yml
JoshuaKGoldberg Jun 8, 2023
af75b9c
Gotta install
JoshuaKGoldberg Jun 8, 2023
4901878
fail-fast: false, and more versions in the matrix
JoshuaKGoldberg Jun 8, 2023
94d5e2d
hmm, are we sure it's installing
JoshuaKGoldberg Jun 8, 2023
f9b2f75
There it is. a dollar
JoshuaKGoldberg Jun 8, 2023
d444d5d
Remove the patch
JoshuaKGoldberg Jun 8, 2023
637f78b
if: always, and older versions to test
JoshuaKGoldberg Jun 8, 2023
f939405
Many more older ones
JoshuaKGoldberg Jun 8, 2023
3020bf7
eeeven older
JoshuaKGoldberg Jun 8, 2023
a0dc4b4
patch-package to fix build
JoshuaKGoldberg Jun 8, 2023
f6b126d
Switch to commits with use-local-typescript-version.mjs
JoshuaKGoldberg Jun 9, 2023
54375f3
Tweaked naming, and npx hereby
JoshuaKGoldberg Jun 9, 2023
44f61b3
isVersionAtLeast is not working
JoshuaKGoldberg Jun 9, 2023
886a7ea
Update commits range
JoshuaKGoldberg Jun 9, 2023
554716d
Newer commits
JoshuaKGoldberg Jun 9, 2023
cd3ae66
Newer commits
JoshuaKGoldberg Jun 9, 2023
8eda639
Narrow down commits more
JoshuaKGoldberg Jun 9, 2023
9093c95
Add log to top of file
JoshuaKGoldberg Jun 9, 2023
3872d30
Write to localTypeScript
JoshuaKGoldberg Jun 9, 2023
9c05c09
Just realized I was bisecting th ewrong way, perhaps
JoshuaKGoldberg Jun 9, 2023
cf26f7a
Thanks Jake, lkg
JoshuaKGoldberg Jun 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/prepare-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ runs:
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
yarn --ignore-engines --frozen-lockfile --ignore-scripts
yarn --ignore-engines --ignore-scripts
yarn check-clean-workspace-after-install
yarn patch-package
244 changes: 30 additions & 214 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,88 +56,36 @@ jobs:
- name: Build
uses: ./.github/actions/prepare-build

lint_without_build:
name: Lint
needs: [install]
runs-on: ubuntu-latest
strategy:
matrix:
lint-task: ['check-spelling', 'check-format', 'lint-markdown']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}

- name: Run Check
run: yarn ${{ matrix.lint-task }}

lint_with_build:
name: Lint
# because we lint with our own tooling, we need to build
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
lint-task: ['lint', 'typecheck']
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Build
uses: ./.github/actions/prepare-build

- name: Run Check
run: yarn ${{ matrix.lint-task }}

integration_tests:
name: Run integration tests on primary Node.js version
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- name: Build
uses: ./.github/actions/prepare-build

- name: Run integrations tests
run: yarn test-integration
env:
CI: true

unit_tests:
name: Run Unit Tests
name: Run Specific Unit Tests
needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# just run on the oldest and latest supported versions and assume the intermediate versions are good
node-version: [14, 18]
package:
commit:
[
'ast-spec',
'eslint-plugin',
'eslint-plugin-internal',
'eslint-plugin-tslint',
'parser',
'scope-manager',
'type-utils',
'typescript-estree',
'utils',
'visitor-keys',
'HEAD',
'0e34f187c82ec725aa7dd5588c249ca3c32d999c',
'6dbec02a88156121c24a152d1e8e5e82d52fdc1d',
'43cc362cef72e5fa1372f59736a9c4b55d85def0',
'4b6fb95f040c5c81743e19a56df8fa99bf3d139f',
'7bee9c55b1b90a7711c8a635dfc6de102ab069fe',
'1da6d87a053746901a7eca6395a4bd15190b13c4',
'8b87de17503b15b08be40adcf3255d5d67aa2427',
'4c7e3279810318b389aa2af843ee1df897efd479',
'958487bedac2f9990387ca0f65f977a7f7c18297',
'211a60dc7931326eaaa02d3b7e2c1c20b1e6dfa3',
'fc756ebc17295c3cb5eed18cde87835641099440',
'dcc766f2b25796bea41e7118830326e8639eb7c8',
'941b30c975e6a58fbe535bbe9319412942b028f5',
'e2283e99b47942b863d016c65a3e430dca1549b9',
'835fff8106e0cdf2e53028cd0e2c9759b426ebb4',
]
package: ['typescript-estree']
env:
# Added the - at the end to function as a separator to improve readability in the PR comment from the Nx cloud app
NX_CLOUD_ENV_NAME: 'Node ${{ matrix.node-version }} -'
NX_CLOUD_ENV_NAME: 'Node 18 Testing -'
COLLECT_COVERAGE: false
steps:
- name: Checkout
Expand All @@ -147,148 +95,16 @@ jobs:
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ matrix.node-version }}
node-version: 18
- name: Build
uses: ./.github/actions/prepare-build

# collect coverage on the primary node version
# we don't collect coverage on other node versions so they run faster
# note that we don't do this as a single `run` with a flag because some
# packages don't collect coverage on purpose, so forcing `--coverage=true`
# would override the config
- name: Run unit tests with coverage for ${{ matrix.package }}
if: env.PRIMARY_NODE_VERSION == matrix.node-version
run: npx nx test ${{ matrix.package }}
- name: Use Local TypeScript Version
run: |
node ./use-local-typescript-version.mjs ${{ matrix.commit }}
cat typescript-local/package.json
node typescript-local/lib/tsc.js --version
- name: Run unit tests for Node 18
if: always()
run: npx nx test ${{ matrix.package }} --coverage=false default-program-success.test.ts
env:
CI: true
- name: Run unit tests for ${{ matrix.package }}
if: env.PRIMARY_NODE_VERSION != matrix.node-version
run: npx nx test ${{ matrix.package }} --coverage=false
env:
CI: true

- name: Store coverage for uploading
if: env.PRIMARY_NODE_VERSION == matrix.node-version
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.package }}-coverage
path: packages/${{ matrix.package }}/coverage/lcov.info
# Sadly 1 day is the minimum
retention-days: 1

website_tests:
permissions:
contents: read # to fetch code (actions/checkout)

name: Website tests
# We technically do not need to wait for build within the pipeline any more because the build we care about is happening within Netlify, however,
# it is highly likely that if the CI one fails, the Netlify one will as well, so in order to not waste unncessary Github Actions minutes/resources,
# we do still keep this requirement here.
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}

- name: Install Playwright Browsers
run: npx playwright install --with-deps

- name: Wait for Netlify deployment
uses: ./.github/actions/wait-for-netlify
id: waitForDeployment
with:
netlify_token: ${{ secrets.NETLIFY_TOKEN }}

- name: Run Playwright tests against the Netlify deployment
run: yarn playwright test --reporter=list
working-directory: packages/website
env:
PLAYWRIGHT_TEST_BASE_URL: ${{ steps.waitForDeployment.outputs.url }}

- if: always()
uses: actions/upload-artifact@v3
with:
name: playwright-report
path: packages/website/playwright-report

upload_coverage:
name: Upload Codecov Coverage
needs: [unit_tests]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download coverage reports
uses: actions/download-artifact@v3
with:
path: coverage

- name: Publish code coverage report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/**/lcov.info
flags: unittest
name: codecov

publish_canary_version:
name: Publish the latest code as a canary version
runs-on: ubuntu-latest
permissions:
id-token: write
needs: [integration_tests, lint_with_build, lint_without_build, unit_tests]
if: github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
- name: Build
uses: ./.github/actions/prepare-build

# Fetch all history for all tags and branches in this job because lerna needs it
- run: |
git fetch --prune --unshallow

- name: Publish all packages to npm
run: npx lerna publish --loglevel=verbose --canary --exact --force-publish --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish_canary_version_v6:
name: Publish the next major version code as a canary version
runs-on: ubuntu-latest
permissions:
id-token: write
needs: [integration_tests, lint_with_build, lint_without_build, unit_tests]
if: github.ref == 'refs/heads/v6'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
- name: Build
uses: ./.github/actions/prepare-build

# Fetch all history for all tags and branches in this job because lerna needs it
- run: |
git fetch --prune --unshallow

- name: Publish all packages to npm
run: npx lerna publish premajor --loglevel=verbose --canary --exact --force-publish --yes --dist-tag rc-v6
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ packages/ast-spec/src/element/AccessorProperty/fixtures
# prettier doesn't yet support `const` modifiers for type parameters
packages/ast-spec/src/special/TSTypeParameter/fixtures

# prettier doesn't yet support JSX namespaced attributes
packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/fixture.tsx
packages/scope-manager/tests/fixtures/jsx/namespaced-attribute.tsx

# Ignore CHANGELOG.md files to avoid issues with automated release job
CHANGELOG.md

Expand Down
2 changes: 1 addition & 1 deletion docs/maintenance/Versioning.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Support for specific Current status releases are considered periodically.

### TypeScript

> The version range of TypeScript currently supported is `>=3.3.1 <5.1.0`.
> The version range of TypeScript currently supported is `>=3.3.1 <5.2.0`.

These versions are what we test against.

Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"@types/is-glob": "^4.0.2",
"@types/jest": "29.4.4",
"@types/jest-specific-snapshot": "^0.5.5",
"@types/lodash": "^4.14.182",
"@types/marked": "^4.0.3",
"@types/ncp": "^2.0.5",
"@types/node": "^18.11.9",
Expand Down Expand Up @@ -112,10 +111,10 @@
"ts-node": "10.7.0",
"tslint": "^6.1.3",
"tsx": "^3.12.1",
"typescript": ">=3.3.1 <5.1.0"
"typescript": ">=3.3.1 <5.2.0"
},
"resolutions": {
"typescript": "~5.0.2",
"typescript": "5.1.0-dev.20230301",
"@types/node": "^18.11.9",
"@jest/create-cache-key-function": "^29",
"@jest/reporters": "^29",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace JSX {
export interface IntrinsicElements {
'foo-bar:baz-bam': any;
}
}

const componentDashed = <foo-bar:baz-bam />;
Loading