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

chore: set TypeScript version range to >=4.2 #75

Merged
merged 7 commits into from
May 6, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
description: Prepares the repo for a typical CI job

name: Prepare
runs:
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: npm
node-version: 18
- run: npm install --frozen-lockfile
shell: bash
using: composite
15 changes: 15 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/prepare
- run: npm run format:check

name: Format

on:
pull_request: ~
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL that ~ means null in YAML. Perhaps just write it as null for clarity?

Is this saying that we don't want to run format checks on PR branches? Why would that be?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh I went the opposite conclusion in https://github.com/JoshuaKGoldberg/template-typescript-node-package - that it implies "run on all of them", which null feels ... the opposite to me?

It means we run format checks on:

  • All pull request commits
  • Commits to main

push:
branches:
- main
15 changes: 15 additions & 0 deletions .github/workflows/lint-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/prepare
- run: npm run lint:docs

name: Lint (Docs)

on:
pull_request: ~
push:
branches:
- main
16 changes: 16 additions & 0 deletions .github/workflows/lint-eslint-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/prepare
- run: npm run build
- run: npm run lint:eslint-docs

name: Format

on:
pull_request: ~
push:
branches:
- main
15 changes: 15 additions & 0 deletions .github/workflows/lint-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/prepare
- run: npm run lint:js

name: Lint (JS)

on:
pull_request: ~
push:
branches:
- main
26 changes: 0 additions & 26 deletions .github/workflows/push.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/prepare
- run: npm i typescript@${{ matrix.typescript }}
- run: npm run test --coverage
strategy:
fail-fast: false
matrix:
typescript: ['4.2', '4.6', '5.0', 'latest']

name: Test

on:
pull_request: ~
push:
branches:
- main
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const value: string = 9001;

## Installation

Make sure you have TypeScript and @typescript-eslint/parser installed, then install the plugin:
Make sure you have TypeScript >=4.2 and @typescript-eslint/parser installed, then install the plugin:

```sh
npm i -D eslint-plugin-expect-type
Expand Down Expand Up @@ -44,9 +44,9 @@ Then, you'll be able to use `^?`, `$ExpectError`, `$ExpectType`, and `$ExpectTyp
🔧 Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
💭 Requires type information.

| Name | Description | 💼 | 🔧 | 💭 |
| :----------------------------- | :----------------------------------------- | :- | :- | :- |
| [expect](docs/rules/expect.md) | Expects type error, type snapshot or type. | ✅ | 🔧 | 💭 |
danvk marked this conversation as resolved.
Show resolved Hide resolved
| Name | Description | 💼 | 🔧 | 💭 |
| :----------------------------- | :------------------------------------------ | :- | :- | :- |
| [expect](docs/rules/expect.md) | Expects type error, type snapshot, or type. | ✅ | 🔧 | 💭 |

<!-- end auto-generated rules list -->
<!-- prettier-ignore-end -->
Expand Down
Loading