Skip to content

Commit 1b6cfa1

Browse files
committed
chore: upgrade deps add configs
- Remove TypeScript config `noImplicitAny` and `noImplicitTHis`. They are both enabled under `strict` in TSC >=5.0 - Remove `noUnusedLocals`: this should be checked by a linter. - Enable skipLibCheck (recommended by TSC) - Remove stripInternal (no use) - Add tsconfig and rome $schema for auto-completion in IDE - Remove `npx` in scripts: it incurs a 30% slowdown. - Specify `--target` for _ESbuild_. _ESbuild_ >= 0.18.0 no longer relies on `tsconfig`'s `target` option.
1 parent 4c5b501 commit 1b6cfa1

File tree

9 files changed

+281
-289
lines changed

9 files changed

+281
-289
lines changed

Diff for: package-lock.json

+255-255
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@
6161
"test": "sh ./scripts/test.sh"
6262
},
6363
"devDependencies": {
64-
"esbuild": "0.17.12",
65-
"oletus": "3.3.0",
66-
"rome": "12.0.0",
67-
"typescript": "5.0.2",
64+
"esbuild": "0.18.0",
65+
"oletus": "4.0.0",
66+
"rome": "12.1.3",
67+
"typescript": "5.1.3",
6868
"validate-commit-message": "3.2.0"
6969
}
7070
}

Diff for: rome.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://docs.rome.tools/schemas/12.1.3/schema.json",
23
"formatter": {
34
"indentStyle": "space",
45
"indentSize": 4,
@@ -7,7 +8,10 @@
78
"linter": {
89
"enabled": true,
910
"rules": {
10-
"all": true
11+
"all": true,
12+
"nursery": {
13+
"useLiteralKeys": "off"
14+
}
1115
}
1216
},
1317
"javascript": {

Diff for: scripts/build.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
#!/bin/sh
22
set -eu
33

4+
# https://node.green/#ES2020
5+
# https://kangax.github.io/compat-table/es2016plus
6+
TARGET=es2020
7+
48
# build ESM
5-
esbuild src/*.ts src/*/*.ts --platform=neutral --outdir=dist --log-level=warning
9+
esbuild src/*.ts src/*/*.ts --target=$TARGET --platform=neutral --outdir=dist --log-level=warning
610

711
# build .d.ts
812
tsc --build src
913

1014
# build CommonJS (fallback)
11-
esbuild src/index.ts --bundle --platform=node > dist/index.cjs
15+
esbuild src/index.ts --bundle --target=$TARGET --platform=node > dist/index.cjs
1216

1317
cp -f dist/index.d.ts dist/index.d.cts

Diff for: src/tsconfig.json

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
{
22
"extends": "../tsconfig-base.json",
33
"compilerOptions": {
4-
"outDir": "../dist",
5-
"noEmit": false,
4+
"composite": true,
65
"emitDeclarationOnly": true,
7-
8-
"composite": true
9-
},
10-
"include": ["**/*.ts"]
6+
"noEmit": false,
7+
"outDir": "../dist"
8+
}
119
}

Diff for: tests/codec/_util.d.ts

-5
This file was deleted.

Diff for: tests/codec/_util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ByteCursor, Config } from "@bare-ts/lib"
22

33
/**
44
*
5-
* @param {...number[]} rest
5+
* @param {...number} rest
66
* @returns {ByteCursor}
77
*/
88
export function fromBytes(...rest) {

Diff for: tests/tsconfig.json

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
{
2-
"extends": "../tsconfig-base.json",
3-
"compilerOptions": {
4-
"moduleResolution": "node",
5-
"paths": { "@bare-ts/lib": ["../src/index.js"] }
6-
},
7-
"include": ["**/*.js", "**/*.ts"],
8-
"references": [{ "path": "../src" }]
2+
"extends": "../tsconfig-base.json"
93
}

Diff for: tsconfig-base.json

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
23
"compilerOptions": {
3-
// https://node.green/#ES2020
4-
// https://kangax.github.io/compat-table/es2016plus
54
"lib": ["ES2020"],
6-
"moduleResolution": "node16",
75
"module": "ES2020",
6+
"moduleResolution": "node16",
87
"target": "ES2020",
98

10-
// Don't implicitly import @types/*
11-
"types": [],
12-
139
"noEmit": true,
14-
"sourceMap": true,
15-
"stripInternal": true,
10+
11+
"types": [],
1612

1713
"esModuleInterop": true,
1814
"isolatedModules": true,
1915
"resolveJsonModule": true,
16+
"skipLibCheck": true,
2017
"verbatimModuleSyntax": true,
2118

2219
"allowUnreachableCode": false,

0 commit comments

Comments
 (0)