Skip to content

Commit 32a9b5c

Browse files
committed
chore: modernize dev tooling and CI
TypeScript 7 (ts-jest and ts-node replaced by @swc/jest and a plain JS copy script), Jest 30, oxlint instead of ESLint, rimraf 6, and a Node 22/24/26 CI matrix with coveralls uploaded from a single job. Only dev dependencies and tooling change.
1 parent f5cdfa5 commit 32a9b5c

8 files changed

Lines changed: 2039 additions & 2984 deletions

File tree

.eslintrc.js

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

.github/workflows/tests.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,20 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
node-version: [10.x, 12.x, 13.x, 14.x]
10+
node-version: [22, 24, 26]
1111

1212
steps:
13-
- uses: actions/checkout@v4
13+
- uses: actions/checkout@v7
1414
- name: Use Node.js ${{ matrix.node-version }}
15-
uses: actions/setup-node@v6
15+
uses: actions/setup-node@v7
1616
with:
1717
node-version: ${{ matrix.node-version }}
1818

1919
- name: EditorConfig Lint
20-
uses: docker://mstruebing/editorconfig-checker:2.7.2
20+
uses: docker://mstruebing/editorconfig-checker:4.0.1
2121

2222
- name: Install
23-
run: |
24-
yarn config set ignore-engines true
25-
yarn
23+
run: yarn
2624

2725
- name: Build
2826
run: yarn build
@@ -31,11 +29,10 @@ jobs:
3129
run: yarn lint
3230

3331
- name: Test
34-
run: |
35-
yarn test > COVERAGE_RESULT
36-
echo "$(cat COVERAGE_RESULT)"
32+
run: yarn test
3733

3834
- name: Coveralls
39-
uses: coverallsapp/github-action@master
35+
if: matrix.node-version == 24
36+
uses: coverallsapp/github-action@v2
4037
with:
4138
github-token: ${{ secrets.GITHUB_TOKEN }}

.oxlintrc.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
3+
"ignorePatterns": [
4+
"**/node_modules",
5+
"**/dist",
6+
"**/coverage",
7+
"**/*.js",
8+
"**/*.d.ts"
9+
],
10+
"plugins": [
11+
"typescript",
12+
"jest"
13+
],
14+
"env": {
15+
"node": true,
16+
"jest": true
17+
},
18+
"categories": {
19+
"correctness": "error",
20+
"suspicious": "error"
21+
},
22+
"rules": {
23+
"no-var": "error",
24+
"prefer-const": "error",
25+
"prefer-rest-params": "error",
26+
"prefer-spread": "error",
27+
"eqeqeq": "error",
28+
"curly": "error",
29+
"no-console": "error",
30+
"no-else-return": "error",
31+
"dot-notation": "error",
32+
"object-shorthand": "error",
33+
"no-throw-literal": "error",
34+
"yoda": "error",
35+
"typescript/no-explicit-any": "off",
36+
"typescript/no-non-null-assertion": "off",
37+
"typescript/ban-ts-comment": "off",
38+
"typescript/no-unused-vars": "off",
39+
"typescript/array-type": "error",
40+
"typescript/consistent-type-assertions": "error",
41+
"typescript/no-inferrable-types": "error",
42+
"typescript/no-namespace": "error",
43+
"typescript/no-this-alias": "error",
44+
"typescript/prefer-optional-chain": "error",
45+
"typescript/no-useless-constructor": "error"
46+
}
47+
}

package.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@
2727
"build": "yarn clean && yarn compile && yarn copy",
2828
"clean": "rimraf ./dist",
2929
"compile": "tsc -p tsconfig.json",
30-
"copy": "ts-node -T ./scripts/copy.ts",
31-
"lint": "eslint src/*.ts",
30+
"copy": "node ./scripts/copy.js",
31+
"lint": "oxlint src tests",
3232
"test": "jest"
3333
},
3434
"jest": {
35-
"preset": "ts-jest",
35+
"transform": {
36+
"^.+\\.ts$": "@swc/jest"
37+
},
3638
"collectCoverage": true,
3739
"collectCoverageFrom": [
3840
"<rootDir>/src/**/*.ts"
@@ -46,15 +48,14 @@
4648
"ansi-colors": "^4.1.1"
4749
},
4850
"devDependencies": {
49-
"@types/jest": "^27.0.0",
50-
"@types/node": "^20.0.0",
51-
"@typescript-eslint/eslint-plugin": "~5.50.0",
52-
"@typescript-eslint/parser": "~5.50.0",
53-
"eslint": "^7.6.0",
54-
"jest": "^27.0.0",
55-
"rimraf": "^3.0.2",
56-
"ts-jest": "^27.0.0",
57-
"ts-node": "^10.0.0",
58-
"typescript": "^4.0.0"
59-
}
51+
"@swc/core": "^1.16.2",
52+
"@swc/jest": "^0.2.39",
53+
"@types/jest": "^30.0.0",
54+
"@types/node": "^24.0.0",
55+
"jest": "^30.5.1",
56+
"oxlint": "^1.81.0",
57+
"rimraf": "^6.1.3",
58+
"typescript": "^7.0.2"
59+
},
60+
"packageManager": "yarn@1.22.22"
6061
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { copyFileSync, readFileSync, writeFileSync } from 'fs';
2-
import { resolve } from 'path';
1+
const { copyFileSync, readFileSync, writeFileSync } = require('fs');
2+
const { resolve } = require('path');
33

4-
function copy(filename: string, from: string, to: string): void {
4+
function copy(filename, from, to) {
55
copyFileSync(resolve(from, filename), resolve(to, filename));
66
}
77

8-
function rewrite(path: string, replacer: (from: string) => string): void {
8+
function rewrite(path, replacer) {
99
const file = readFileSync(path).toString();
1010
const replaced = replacer(file);
1111
writeFileSync(path, replaced);
@@ -15,6 +15,6 @@ const root = resolve(__dirname, '..');
1515
const target = resolve(process.cwd(), 'dist');
1616

1717
copy('README.md', root, target);
18-
copy('LICENSE', root, target);
18+
copy('LICENSE', root, target);
1919
copy('package.json', process.cwd(), target);
2020
rewrite(resolve(target, 'package.json'), pkg => pkg.replace(/dist\//g, ''));

0 commit comments

Comments
 (0)