Skip to content

Commit 6a499b2

Browse files
authored
update dependencies, switch to eslint v9, update tests (#57)
* update dependencies, switch to eslint v9, update tests * update tests node versions * fix typo * 2.0.0
1 parent 2badfcd commit 6a499b2

File tree

10 files changed

+4341
-8729
lines changed

10 files changed

+4341
-8729
lines changed

.eslintrc.js

Lines changed: 0 additions & 41 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
name: Run Tests
22

33
on:
4-
push:
5-
branches: [ "master" ]
6-
pull_request:
7-
branches: [ "master" ]
4+
push:
5+
branches: ['master']
6+
pull_request:
7+
branches: ['master']
88

99
jobs:
10-
build:
11-
runs-on: ubuntu-latest
10+
build:
11+
runs-on: ubuntu-latest
1212

13-
strategy:
14-
matrix:
15-
node-version: [14.x, 16.x]
16-
17-
steps:
18-
- uses: actions/checkout@v3
13+
strategy:
14+
matrix:
15+
node-version: [20.x, 22.x]
1916

20-
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v3
22-
with:
23-
node-version: ${{ matrix.node-version }}
17+
steps:
18+
- uses: actions/checkout@v3
2419

25-
- name: Test
26-
run: |
27-
npm install
28-
npm test
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
25+
- name: Test
26+
run: |
27+
npm install
28+
npm test

eslint.config.mjs

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import globals from 'globals';
2+
import tsParser from '@typescript-eslint/parser';
3+
import path from 'node:path';
4+
import { fileURLToPath } from 'node:url';
5+
import js from '@eslint/js';
6+
import { FlatCompat } from '@eslint/eslintrc';
7+
8+
const __filename = fileURLToPath(import.meta.url);
9+
const __dirname = path.dirname(__filename);
10+
const compat = new FlatCompat({
11+
baseDirectory: __dirname,
12+
recommendedConfig: js.configs.recommended,
13+
allConfig: js.configs.all,
14+
});
15+
16+
export default [
17+
{
18+
ignores: ['**/lib/'],
19+
},
20+
...compat.extends(
21+
'eslint:recommended',
22+
'plugin:eslint-plugin/recommended',
23+
'plugin:node/recommended',
24+
'plugin:prettier/recommended'
25+
),
26+
{
27+
languageOptions: {
28+
globals: {
29+
...globals.node,
30+
},
31+
32+
ecmaVersion: 2021,
33+
sourceType: 'module',
34+
},
35+
36+
settings: {
37+
node: {
38+
tryExtensions: ['.js', '.json', '.node', '.ts', '.d.ts'],
39+
},
40+
},
41+
42+
rules: {
43+
'prettier/prettier': 0,
44+
'eslint-plugin/prefer-message-ids': 1,
45+
},
46+
},
47+
{
48+
files: ['test/**/*.js'],
49+
50+
languageOptions: {
51+
globals: {
52+
...globals.mocha,
53+
},
54+
},
55+
},
56+
...compat.extends('plugin:@typescript-eslint/recommended').map((config) => ({
57+
...config,
58+
files: ['**/*.ts'],
59+
})),
60+
{
61+
files: ['**/*.ts'],
62+
63+
languageOptions: {
64+
parser: tsParser,
65+
},
66+
67+
rules: {
68+
'node/no-unsupported-features/es-syntax': [
69+
'error',
70+
{
71+
ignores: ['modules'],
72+
},
73+
],
74+
},
75+
},
76+
];

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const DEST = 'lib';
77
const tsProject = ts.createProject('tsconfig.json');
88

99
gulp.task('clean', function (done) {
10-
rimraf(DEST, done);
10+
rimraf.rimraf(DEST).then(() => done());
1111
});
1212

1313
gulp.task(

0 commit comments

Comments
 (0)