Skip to content

Commit b588dce

Browse files
author
Dominik Zogg
committed
eslint, node 16
1 parent e708d20 commit b588dce

File tree

6 files changed

+24
-35
lines changed

6 files changed

+24
-35
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('@chubbyts/chubbyts-eslint/dist/eslintrc').default;

.github/workflows/ci.yml

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,15 @@ name: CI
33
on:
44
push:
55
pull_request:
6+
branches:
7+
- master
68
schedule:
79
- cron: '0 0 * * *'
810

911
jobs:
10-
node14:
11-
name: Node 14
12-
runs-on: ubuntu-20.04
13-
steps:
14-
- name: checkout
15-
uses: actions/checkout@v3
16-
- name: checkout node
17-
uses: actions/setup-node@v3
18-
with:
19-
node-version: '14'
20-
- run: npm install
21-
- run: npm run cs
22-
- run: npm test -- --coverage --no-cache
23-
- run: npm run infection
24-
env:
25-
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
2612
node16:
2713
name: Node 16
28-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-22.04
2915
steps:
3016
- name: checkout
3117
uses: actions/checkout@v3
@@ -34,14 +20,10 @@ jobs:
3420
with:
3521
node-version: '16'
3622
- run: npm install
37-
- run: npm run cs
38-
- run: npm test -- --coverage --no-cache
39-
- run: npm run infection
40-
env:
41-
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
23+
- run: npm test
4224
node18:
4325
name: Node 18
44-
runs-on: ubuntu-20.04
26+
runs-on: ubuntu-22.04
4527
steps:
4628
- name: checkout
4729
uses: actions/checkout@v3
@@ -50,6 +32,7 @@ jobs:
5032
with:
5133
node-version: '18'
5234
- run: npm install
35+
- run: npm run lint
5336
- run: npm run cs
5437
- run: npm test -- --coverage --no-cache
5538
- run: npm run infection

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ It converts any throwable into an Error.
2323

2424
## Requirements
2525

26-
* node: 14
26+
* node: 16
2727

2828
## Installation
2929

3030
Through [NPM](https://www.npmjs.com) as [@chubbyts/chubbyts-throwable-to-error][1].
3131

3232
```ts
33-
npm i @chubbyts/chubbyts-throwable-to-error@^1.0.1
33+
npm i @chubbyts/chubbyts-throwable-to-error@^1.1.0
3434
```
3535

3636
## Usage

package.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@chubbyts/chubbyts-throwable-to-error",
3-
"version": "1.0.1",
3+
"version": "1.1.0",
44
"description": "It converts any throwable into an Error.",
55
"keywords": [
66
"chubbyts",
@@ -13,6 +13,8 @@
1313
"scripts": {
1414
"cs-fix": "prettier --write src tests",
1515
"cs": "prettier --check src tests",
16+
"lint-fix": "eslint src tests --fix",
17+
"lint": "eslint src tests",
1618
"test": "jest",
1719
"infection": "stryker run",
1820
"build": "rm -Rf dist && tsc",
@@ -40,18 +42,19 @@
4042
"dist"
4143
],
4244
"engines": {
43-
"node": ">=14"
45+
"node": ">=16"
4446
},
4547
"dependencies": {},
4648
"devDependencies": {
47-
"@stryker-mutator/core": "^6.4.1",
48-
"@stryker-mutator/jest-runner": "^6.4.1",
49-
"@types/jest": "^29.5.0",
50-
"@types/node": "^18.15.3",
49+
"@chubbyts/chubbyts-eslint": "^1.1.1",
50+
"@stryker-mutator/core": "^6.4.2",
51+
"@stryker-mutator/jest-runner": "^6.4.2",
52+
"@types/jest": "^29.5.1",
53+
"@types/node": "^20.1.1",
5154
"jest": "^29.5.0",
52-
"prettier": "^2.8.4",
53-
"ts-jest": "^29.0.5",
54-
"typescript": "^4.9.5"
55+
"prettier": "^2.8.8",
56+
"ts-jest": "^29.1.0",
57+
"typescript": "^5.0.4"
5558
},
5659
"publishConfig": {
5760
"access": "public"

src/throwable-to-error.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ export const throwableToError = (e: unknown): Error => {
44
}
55

66
const error = new Error(typeof e === 'object' ? `${JSON.stringify(e)}` : `${String(e)}`);
7+
// eslint-disable-next-line functional/immutable-data
78
error.name = typeof e;
9+
// eslint-disable-next-line functional/immutable-data
810
error.stack = undefined;
911

1012
return error;

tests/throwable-to-error.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('throwableToError', () => {
2727
e: new Array('example'),
2828
error: { name: 'object', message: '["example"]' },
2929
},
30-
])(`converts $e to error`, ({ e, error }) => {
30+
])('converts $e to error', ({ e, error }) => {
3131
expect(throwableToError(e)).toMatchObject(error);
3232
});
3333
});

0 commit comments

Comments
 (0)