Skip to content

Commit 8ce67b1

Browse files
authored
Upgrade setup and use Node 20 (#3)
* Update eslint and mocha setup * Update workflow * Fix and supress eslint errors
1 parent 459a69d commit 8ce67b1

File tree

17 files changed

+2218
-3894
lines changed

17 files changed

+2218
-3894
lines changed

.eslintrc.json

-16
This file was deleted.

.github/workflows/node.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-node@v2
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
1616
with:
17-
node-version: '16'
17+
node-version: '20'
1818

1919
- run: npm ci
2020
- run: npm run lint

.mocharc.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extension": ["ts"],
3+
"spec": "test/**/*.spec.ts",
4+
"require": "ts-node/register"
5+
}

eslint.config.mjs

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import love from 'eslint-config-love'
2+
import tseslint from 'typescript-eslint'
3+
4+
export default [
5+
love,
6+
...tseslint.configs.strictTypeChecked,
7+
...tseslint.configs.stylisticTypeChecked,
8+
{
9+
plugins: {
10+
tseslint: tseslint
11+
},
12+
rules: {
13+
'@typescript-eslint/restrict-template-expressions': ['error', {
14+
allowNumber: true,
15+
}],
16+
"@typescript-eslint/unbound-method": ['error', {
17+
ignoreStatic: true,
18+
}],
19+
},
20+
languageOptions: {
21+
parser: tseslint.parser,
22+
parserOptions: {
23+
ecmaVersion: 'latest',
24+
sourceType: 'module'
25+
}
26+
}
27+
},
28+
{
29+
ignores: ['dist/**/*.*', '**/*.js', '**/*.mjs']
30+
},
31+
{
32+
files: ['src/**/*.ts'],
33+
languageOptions: {
34+
parserOptions: {
35+
project: ['tsconfig.json']
36+
}
37+
}
38+
},
39+
{
40+
files: ['test/**/*.ts'],
41+
languageOptions: {
42+
parserOptions: {
43+
project: ['tsconfig.test.json']
44+
}
45+
},
46+
rules: {
47+
'@typescript-eslint/restrict-template-expressions': ['error', {
48+
allowNumber: true,
49+
}],
50+
}
51+
}
52+
]

0 commit comments

Comments
 (0)