Skip to content

Commit 8bcd9ed

Browse files
committed
chore: Refactor to use typescript-eslint
1 parent 8282b2f commit 8bcd9ed

20 files changed

+2873
-2815
lines changed

.eslintrc.json

-18
This file was deleted.

.github/dependabot.yml

+5
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ updates:
99
directory: "/" # Location of package manifests
1010
schedule:
1111
interval: "daily"
12+
13+
- package-ecosystem: "npm" # See documentation for possible values
14+
directory: "/example" # Location of package manifests
15+
schedule:
16+
interval: "daily"

.github/workflows/release.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,32 @@ jobs:
1515
name: Release
1616
runs-on: ubuntu-latest
1717
steps:
18-
## Setup
1918
# https://github.com/marketplace/actions/checkout
2019
- name: Checkout Repository
21-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
21+
2222
# https://github.com/marketplace/actions/setup-pnpm
23-
- uses: pnpm/action-setup@v2.0.1
23+
- uses: pnpm/action-setup@v3.0.0
2424
name: Install pnpm
2525
id: pnpm-install
2626
with:
2727
version: latest
2828
run_install: false
29+
2930
# https://github.com/marketplace/actions/setup-node-js-environment
3031
- name: Setup NodeJS
31-
uses: actions/setup-node@v3
32+
uses: actions/setup-node@v4
3233
with:
3334
cache: pnpm
3435
node-version: lts/*
3536
check-latest: true
37+
3638
- name: Install dependencies
3739
run: pnpm install --frozen-lockfile
3840

39-
## Steps
4041
- name: Build Lib
4142
run: pnpm build
43+
4244
- name: Release
4345
env:
4446
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/run-unit-tests.yml

+14-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run Unit-Tests
1+
name: Pull Request
22
on:
33
pull_request:
44
push:
@@ -10,41 +10,39 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
jobs:
13-
unit-tests:
14-
name: Run Unit-Tests
13+
pull-request:
1514
runs-on: ubuntu-latest
1615
steps:
1716
# https://github.com/marketplace/actions/checkout
1817
- name: Checkout Repository
19-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
2019

2120
# https://github.com/marketplace/actions/setup-pnpm
22-
- uses: pnpm/[email protected]
23-
name: Install pnpm
24-
id: pnpm-install
21+
- name: Install pnpm
22+
uses: pnpm/[email protected]
2523
with:
2624
version: latest
2725
run_install: false
2826

2927
# https://github.com/marketplace/actions/setup-node-js-environment
3028
- name: Setup NodeJS
31-
uses: actions/setup-node@v3
29+
uses: actions/setup-node@v4
3230
with:
3331
cache: pnpm
3432
node-version: lts/*
3533
check-latest: true
3634

3735
- name: Install dependencies
38-
run: pnpm install ${{ github.actor != 'dependabot[bot]' && '--frozen-lockfile' || '--no-frozen-lockfile' }}
36+
run: pnpm recursive install ${{ github.actor != 'dependabot[bot]' && '--frozen-lockfile' || '--no-frozen-lockfile' }}
37+
38+
- run: echo "${{ toJSON(env) }}"
39+
40+
- name: Build
41+
run: pnpm build
3942

4043
- name: Lint
4144
run: pnpm lint
4245

43-
- name: Run Unit-Tests
44-
run: pnpm test:src
45-
46-
- name: Type Check
47-
run: pnpm build
46+
- name: Unit-Tests
47+
run: pnpm test
4848

49-
- name: Run example Unit-Tests
50-
run: cd example && pnpm install ${{ github.actor != 'dependabot[bot]' && '--frozen-lockfile' || '--no-frozen-lockfile' }} && pnpm test

.vscode/extensions.json

-3
This file was deleted.

eslint.config.mjs

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import eslint from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
import prettierConfig from 'eslint-config-prettier';
4+
5+
export default tseslint.config(
6+
eslint.configs.recommended,
7+
...tseslint.configs.recommendedTypeChecked,
8+
{
9+
rules: {
10+
'@typescript-eslint/no-explicit-any': 'off',
11+
'@typescript-eslint/no-unsafe-argument': 'off',
12+
'@typescript-eslint/no-unsafe-member-access': 'warn',
13+
'@typescript-eslint/no-unsafe-call': 'warn',
14+
'@typescript-eslint/no-unsafe-assignment': 'warn',
15+
'@typescript-eslint/no-unsafe-return': 'warn',
16+
'@typescript-eslint/no-unused-vars': 'warn',
17+
'@typescript-eslint/unbound-method': 'warn',
18+
'@typescript-eslint/require-await': 'warn',
19+
'@typescript-eslint/ban-ts-comment': 'warn',
20+
},
21+
},
22+
{
23+
languageOptions: {
24+
parserOptions: {
25+
project: true,
26+
tsconfigRootDir: import.meta.dirname,
27+
},
28+
},
29+
},
30+
{
31+
files: [
32+
'**/*.mjs'
33+
],
34+
...tseslint.configs.disableTypeChecked,
35+
},
36+
{
37+
ignores: ['lib/**', '**/coverage/**']
38+
},
39+
prettierConfig,
40+
);

0 commit comments

Comments
 (0)