@rsbuild/plugin-type-check 1.3.4 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -35,7 +35,7 @@ Add plugin to your `rsbuild.config.ts`:
35
35
 
36
36
  ```ts
37
37
  // rsbuild.config.ts
38
- import { pluginTypeCheck } from "@rsbuild/plugin-type-check";
38
+ import { pluginTypeCheck } from '@rsbuild/plugin-type-check';
39
39
 
40
40
  export default {
41
41
  plugins: [pluginTypeCheck()],
@@ -86,7 +86,7 @@ Enable type checking only in production mode:
86
86
 
87
87
  ```js
88
88
  pluginTypeCheck({
89
- enable: process.env.NODE_ENV === "production",
89
+ enable: process.env.NODE_ENV === 'production',
90
90
  });
91
91
  ```
92
92
 
@@ -94,7 +94,7 @@ Enable type checking only in development mode (it is not recommended to disable
94
94
 
95
95
  ```js
96
96
  pluginTypeCheck({
97
- enable: process.env.NODE_ENV === "development",
97
+ enable: process.env.NODE_ENV === 'development',
98
98
  });
99
99
  ```
100
100
 
@@ -110,7 +110,7 @@ const defaultOptions = {
110
110
  typescript: {
111
111
  // set 'readonly' to avoid emitting tsbuildinfo,
112
112
  // as the generated tsbuildinfo will break ts-checker-rspack-plugin
113
- mode: "readonly",
113
+ mode: 'readonly',
114
114
  // enable build when using project reference
115
115
  build: useReference,
116
116
  // avoid OOM issue
@@ -118,11 +118,11 @@ const defaultOptions = {
118
118
  // use tsconfig of user project
119
119
  configFile: tsconfigPath,
120
120
  // use typescript of user project
121
- typescriptPath: require.resolve("typescript"),
121
+ typescriptPath: require.resolve('typescript'),
122
122
  },
123
123
  issue: {
124
124
  // ignore types errors from node_modules
125
- exclude: [({ file = "" }) => /[\\/]node_modules[\\/]/.test(file)],
125
+ exclude: [({ file = '' }) => /[\\/]node_modules[\\/]/.test(file)],
126
126
  },
127
127
  logger: {
128
128
  log() {
@@ -130,7 +130,7 @@ const defaultOptions = {
130
130
  // we only want to display error messages
131
131
  },
132
132
  error(message: string) {
133
- console.error(message.replace(/ERROR/g, "Type Error"));
133
+ console.error(message.replace(/ERROR/g, 'Type Error'));
134
134
  },
135
135
  },
136
136
  };
@@ -144,7 +144,7 @@ When the value of `tsCheckerOptions` is an object, it will be deeply merged with
144
144
  pluginTypeCheck({
145
145
  tsCheckerOptions: {
146
146
  issue: {
147
- exclude: [({ file = "" }) => /[\\/]some-folder[\\/]/.test(file)],
147
+ exclude: [({ file = '' }) => /[\\/]some-folder[\\/]/.test(file)],
148
148
  },
149
149
  },
150
150
  });
@@ -174,7 +174,7 @@ pluginTypeCheck({
174
174
  tsCheckerOptions: {
175
175
  issue: {
176
176
  // Ignore "Argument of type 'string' is not assignable to parameter of type 'number'.ts(2345)"
177
- exclude: [{ code: "TS2345" }],
177
+ exclude: [{ code: 'TS2345' }],
178
178
  },
179
179
  },
180
180
  });
@@ -186,7 +186,7 @@ Or exclude files under `/some-folder/` using `file`:
186
186
  pluginTypeCheck({
187
187
  tsCheckerOptions: {
188
188
  issue: {
189
- exclude: [({ file = "" }) => /[\\/]some-folder[\\/]/.test(file)],
189
+ exclude: [({ file = '' }) => /[\\/]some-folder[\\/]/.test(file)],
190
190
  },
191
191
  },
192
192
  });
@@ -206,6 +206,7 @@ pluginTypeCheck({
206
206
  },
207
207
  });
208
208
  ```
209
+
209
210
  ## Notes
210
211
 
211
212
  - If you have enabled `ts-loader` in your project and manually configured `compileOnly: false`, please disable the Type Check plugin to avoid duplicate type checking.
@@ -238,8 +239,8 @@ npm add @esctn/vue-tsc-api -D
238
239
  pluginTypeCheck({
239
240
  tsCheckerOptions: {
240
241
  typescript: {
241
- typescriptPath: '@esctn/vue-tsc-api'
242
- }
242
+ typescriptPath: '@esctn/vue-tsc-api',
243
+ },
243
244
  },
244
245
  });
245
246
  ```
package/dist/index.cjs CHANGED
@@ -71,7 +71,7 @@ const pluginTypeCheck = (options = {})=>({
71
71
  api.context.rootPath
72
72
  ]
73
73
  });
74
- } catch (err) {
74
+ } catch {
75
75
  logger.warn('"typescript" is not found in current project, Type checker will not work.');
76
76
  return;
77
77
  }
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ const pluginTypeCheck = (options = {})=>({
27
27
  api.context.rootPath
28
28
  ]
29
29
  });
30
- } catch (err) {
30
+ } catch {
31
31
  logger.warn('"typescript" is not found in current project, Type checker will not work.');
32
32
  return;
33
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/plugin-type-check",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "repository": "https://github.com/rstackjs/rsbuild-plugin-type-check",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -17,41 +17,27 @@
17
17
  "files": [
18
18
  "dist"
19
19
  ],
20
- "scripts": {
21
- "build": "rslib build",
22
- "dev": "rslib build --watch",
23
- "lint": "biome check .",
24
- "lint:write": "biome check . --write",
25
- "prepare": "simple-git-hooks && npm run build",
26
- "test": "playwright test",
27
- "bump": "npx bumpp"
28
- },
29
20
  "simple-git-hooks": {
30
- "pre-commit": "npx nano-staged"
31
- },
32
- "nano-staged": {
33
- "*.{js,jsx,ts,tsx,mjs,cjs}": [
34
- "biome check --write --no-errors-on-unmatched"
35
- ]
21
+ "pre-commit": "pnpm run lint:write"
36
22
  },
37
23
  "dependencies": {
38
24
  "deepmerge": "^4.3.1",
39
25
  "ts-checker-rspack-plugin": "^1.3.0",
40
26
  "json5": "^2.2.3",
41
- "reduce-configs": "^1.1.1"
27
+ "reduce-configs": "^1.1.2"
42
28
  },
43
29
  "devDependencies": {
44
- "@biomejs/biome": "^1.9.4",
45
- "@playwright/test": "^1.58.2",
46
- "@rsbuild/core": "^1.7.3",
47
- "@rslib/core": "^0.19.6",
30
+ "@playwright/test": "^1.60.0",
31
+ "@rsbuild/core": "^2.0.7",
32
+ "@rslib/core": "^0.21.5",
33
+ "@rslint/core": "^0.5.3",
48
34
  "@types/fs-extra": "^11.0.4",
49
- "@types/node": "^24.10.13",
50
- "fs-extra": "^11.3.3",
51
- "nano-staged": "^0.9.0",
52
- "playwright": "^1.58.2",
35
+ "@types/node": "^24.12.4",
36
+ "fs-extra": "^11.3.5",
37
+ "playwright": "^1.60.0",
38
+ "prettier": "^3.8.3",
53
39
  "simple-git-hooks": "^2.13.1",
54
- "typescript": "^5.9.3"
40
+ "typescript": "^6.0.3"
55
41
  },
56
42
  "peerDependencies": {
57
43
  "@rsbuild/core": "^1.0.0 || ^2.0.0-0"
@@ -61,9 +47,16 @@
61
47
  "optional": true
62
48
  }
63
49
  },
64
- "packageManager": "pnpm@10.30.1",
65
50
  "publishConfig": {
66
51
  "access": "public",
67
52
  "registry": "https://registry.npmjs.org/"
53
+ },
54
+ "scripts": {
55
+ "build": "rslib",
56
+ "dev": "rslib -w",
57
+ "lint": "rslint && prettier -c .",
58
+ "lint:write": "rslint --fix && prettier -w .",
59
+ "test": "playwright test",
60
+ "bump": "npx bumpp"
68
61
  }
69
- }
62
+ }