Skip to content

Commit

Permalink
Remove double comment feature
Browse files Browse the repository at this point in the history
TypeScript seems to always bail out when there's one error.
  • Loading branch information
jhnns committed Jun 25, 2024
1 parent 0e2ba97 commit 1d3894c
Show file tree
Hide file tree
Showing 11 changed files with 1,699 additions and 20,883 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": [
"peerigon/presets/prettier-typescript.js"
"peerigon/presets/typescript.js"
],
"env": {
"node": true
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,28 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [22.x]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/cancel-workflow-action@a40b8845c0683271d9f53dfcb887a7e181d3918b # [email protected]
- name: ⬇️ Checkout repo
uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6 # pin@v2
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # pin@main
- name: ⎔ Setup node ${{ matrix.node-version }}
uses: actions/setup-node@1f8c6b94b26d0feae1e387ca63ccbdc44d27b561 # pin@v2
uses: actions/setup-node@eff380dfbcf941bf8832e4acb788cebe13dfd758 # pin@main
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: 🗄 Cache node_modules
id: cache-node_modules
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # pin@v2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # pin@main
with:
path: "**/node_modules"
key: node_modules-${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
- name: 🗄 Cache .eslintcache
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed # pin@v2
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # pin@main
with:
path: .eslintcache
key: eslintcache-${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -47,7 +49,7 @@ jobs:
env:
CI: true
- name: 🚀 Release on GitHub
if: "contains(' refs/heads/main refs/heads/beta ', github.ref) && matrix.node-version == '16.x'"
if: "contains(' refs/heads/main refs/heads/beta ', github.ref) && matrix.node-version == '22.x'"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.15.0
v22.3.0
20 changes: 1 addition & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,6 @@ Now you need to add the TypeScript language service plugin to your `tsconfig.jso
}
```

## Support for multiple errors

If you expect more than one error, you can add multiple comments, like this:

```ts
type Person = {
readonly name: string;
};

const person: Person = {
name: "Bob",
};

// 💥 Expect error 2704: … cannot be a read-only property.
// 💥 Expect error 2790: … must be optional.
delete person.name;
```

## API

### assertProgramToOnlyHaveExpectedErrors(<br>&nbsp;&nbsp;&nbsp;&nbsp;programPath: string,<br>&nbsp;&nbsp;&nbsp;&nbsp;compilerOptions?: ts.CompilerOptions,<br>): void
Expand All @@ -103,7 +85,7 @@ assertProgramToOnlyHaveExpectedErrors("/path/to/module.ts"); // may throw

assertProgramToOnlyHaveExpectedErrors(
"/path/to/module.ts",
{ strict: true } // custom compiler options
{ strict: true }, // custom compiler options
);
```

Expand Down
Loading

0 comments on commit 1d3894c

Please sign in to comment.