Skip to content

Commit

Permalink
feat: Update dependencies
Browse files Browse the repository at this point in the history
BREAKING CHANGE: We had to remove support for multiple errors as TypeScript will only report one error at a time now.
  • Loading branch information
jhnns authored Jun 25, 2024
2 parents 3446e6f + 215e700 commit e17480a
Show file tree
Hide file tree
Showing 13 changed files with 9,615 additions and 25,201 deletions.
12 changes: 5 additions & 7 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"extends": [
"peerigon/presets/prettier-typescript.js"
],
"env": {
"node": true
},
"root": true
"extends": ["peerigon/presets/typescript.js"],
"env": {
"node": true
},
"root": true
}
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 # pin@0.9.1
- 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 @@
v16.13.1
v22.3.0
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
Expand Down
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 e17480a

Please sign in to comment.