Skip to content

Commit 75242cb

Browse files
authored
chore: upgrade TypeScript to 6.0.2 (#66)
1 parent 57a9b1a commit 75242cb

File tree

6 files changed

+52
-38
lines changed

6 files changed

+52
-38
lines changed

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
"main": "./dist/index.cjs",
1515
"module": "./dist/index.js",
1616
"types": "./dist/index.d.ts",
17-
"files": [
18-
"dist"
19-
],
17+
"files": ["dist"],
2018
"scripts": {
2119
"build": "rslib",
2220
"dev": "rslib -w",
@@ -53,7 +51,7 @@
5351
"rslog": "^1.3.2",
5452
"simple-git-hooks": "^2.13.1",
5553
"strip-ansi": "^7.2.0",
56-
"typescript": "^5.9.3",
54+
"typescript": "6.0.2",
5755
"upath": "^2.0.1"
5856
},
5957
"peerDependencies": {

pnpm-lock.yaml

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rstest.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig } from '@rstest/core';
2+
3+
process.env.NO_COLOR = 'true';
4+
5+
export default defineConfig({});
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Rstest Snapshot v1
2+
3+
exports[`#displayCodePointer - should display code pointer correctly 1`] = `
4+
"
5+
code: .webpackChunktmp||[]).push([[179],{530:()=>{console.log(1);let e=1;e="2"}},e=>{v
6+
^"
7+
`;
8+
9+
exports[`#makeCodeFrame = should make code frame correctly 1`] = `
10+
"
11+
> 1 | const a = 1;
12+
2 |
13+
3 | var b = 2;
14+
4 | "
15+
`;
16+
17+
exports[`#makeCodeFrame = should make code frame correctly 2`] = `
18+
"
19+
2 |
20+
3 | var b = 2;
21+
4 |
22+
> 5 | console.log(() => {
23+
6 | return a + b;
24+
7 | });
25+
8 | "
26+
`;

test/helpers.test.ts

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,12 @@ test('#makeCodeFrame = should make code frame correctly', () => {
6464
'var c = 3;',
6565
];
6666

67-
expect(makeCodeFrame(lines, 0)).toEqual(`
68-
 > 1 | const a = 1;
69-
 2 | 
70-
 3 | var b = 2;
71-
 4 | `);
72-
expect(makeCodeFrame(lines, 4)).toEqual(`
73-
 2 | 
74-
 3 | var b = 2;
75-
 4 | 
76-
 > 5 | console.log(() => {
77-
 6 | return a + b;
78-
 7 | });
79-
 8 | `);
67+
expect(makeCodeFrame(lines, 0)).toMatchSnapshot();
68+
expect(makeCodeFrame(lines, 4)).toMatchSnapshot();
8069
});
8170

8271
test('#displayCodePointer - should display code pointer correctly', () => {
8372
const code =
8473
'(self.webpackChunktmp=self.webpackChunktmp||[]).push([[179],{530:()=>{console.log(1);let e=1;e="2"}},e=>{var l;l=530,e(e.s=l)}]);';
85-
expect(`\n code: ${displayCodePointer(code, 66)}`).toEqual(`
86-
code: .webpackChunktmp||[]).push([[179],{530:()=>{console.log(1);let e=1;e="2"}},e=>{v
87-
 ^`);
74+
expect(`\n code: ${displayCodePointer(code, 66)}`).toMatchSnapshot();
8875
});

tsconfig.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
{
22
"compilerOptions": {
3+
"rootDir": "./src",
34
"outDir": "./dist",
4-
"baseUrl": "./",
5-
"target": "ES2020",
5+
"target": "ES2023",
6+
"types": ["node"],
67
"lib": ["DOM", "ESNext"],
7-
"module": "Node16",
8-
"strict": true,
98
"declaration": true,
109
"isolatedModules": true,
11-
"esModuleInterop": true,
1210
"skipLibCheck": true,
13-
"resolveJsonModule": true,
14-
"moduleResolution": "Node16"
11+
"module": "nodenext",
12+
"moduleResolution": "nodenext"
1513
},
1614
"include": ["src"]
1715
}

0 commit comments

Comments
 (0)