@vocawiki/tsconfig 0.0.0-stage → 0.1.1

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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +57 -2
  3. package/base.json +31 -0
  4. package/package.json +25 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vocawiki contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,58 @@
1
- # Temporary Holding Version
1
+ # @vocawiki/tsconfig
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Vocawiki 共享的 TypeScript 配置。
4
+
5
+ 内容源自 `vocawiki-frontend` 的 `tsconfig.base.json`,只保留与具体项目无关的编译选项:
6
+ 它**不包含** `target`、`module`、`lib`、`paths`、`include` 等与运行环境强绑定的字段,请在使用项目中自行补充。
7
+
8
+ ## 安装
9
+
10
+ ```bash
11
+ pnpm add -D @vocawiki/tsconfig
12
+ ```
13
+
14
+ ## 使用
15
+
16
+ ```json
17
+ {
18
+ "extends": "@vocawiki/tsconfig/base"
19
+ }
20
+ ```
21
+
22
+ 最小的可用示例:
23
+
24
+ ```json
25
+ {
26
+ "extends": "@vocawiki/tsconfig/base",
27
+ "compilerOptions": {
28
+ "target": "esnext",
29
+ "module": "esnext",
30
+ "lib": ["ESNext"]
31
+ }
32
+ }
33
+ ```
34
+
35
+ ## 刻意关闭的配置项
36
+
37
+ ```jsonc
38
+ "noUnusedLocals": false,
39
+ "noUnusedParameters": false,
40
+ ```
41
+
42
+ 未使用的变量与参数交给 [Oxlint](../oxlint-config/README.md) 检查:Lint 支持 `_` 前缀约定、能识别仅类型层面的使用,且报错位置与修复建议更友好。
43
+
44
+ ## 常见搭配
45
+
46
+ ```bash
47
+ pnpm add -D @vocawiki/tsconfig
48
+ ```
49
+
50
+ `package.json`:
51
+
52
+ ```json
53
+ {
54
+ "scripts": {
55
+ "lint:tsc": "tsc --noEmit"
56
+ }
57
+ }
58
+ ```
package/base.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "compilerOptions": {
3
+ // Environment setup
4
+ "moduleDetection": "force",
5
+ "jsx": "react-jsx",
6
+ "allowJs": true,
7
+
8
+ // Bundler mode
9
+ "moduleResolution": "bundler",
10
+ "allowImportingTsExtensions": true,
11
+ "verbatimModuleSyntax": true,
12
+ "noEmit": true,
13
+
14
+ // Best practices
15
+ "isolatedModules": true,
16
+ "erasableSyntaxOnly": true,
17
+ "strict": true,
18
+ "skipLibCheck": true,
19
+ "noFallthroughCasesInSwitch": true,
20
+ "noUncheckedIndexedAccess": true,
21
+ "noImplicitOverride": true,
22
+ "noUnusedLocals": false, // 由 Oxlint 管理
23
+ "noUnusedParameters": false, // 由 Oxlint 管理
24
+ "noPropertyAccessFromIndexSignature": false,
25
+ "forceConsistentCasingInFileNames": true,
26
+ "noImplicitAny": true,
27
+ "noImplicitReturns": true,
28
+ "noImplicitThis": true,
29
+ "noUncheckedSideEffectImports": true
30
+ }
31
+ }
package/package.json CHANGED
@@ -1,6 +1,28 @@
1
1
  {
2
2
  "name": "@vocawiki/tsconfig",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.1",
4
+ "description": "Vocawiki项目共享的TypeScript配置",
5
+ "keywords": [
6
+ "tsconfig",
7
+ "typescript",
8
+ "config"
9
+ ],
10
+ "license": "MIT",
11
+ "type": "module",
12
+ "files": [
13
+ "base.json"
14
+ ],
15
+ "exports": {
16
+ "./base": "./base.json",
17
+ "./base.json": "./base.json"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/Vocawiki/project-configs.git",
22
+ "directory": "packages/tsconfig"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public",
26
+ "provenance": true
27
+ }
6
28
  }