@allkit/tsconfig 0.0.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.
- package/package.json +19 -0
- package/skill/SKILL.md +32 -0
- package/skill/examples/tsconfig.example.json +11 -0
- package/skill/references/tsconfig.node.md +12 -0
- package/skill/references/tsconfig.vitest.md +12 -0
- package/skill/references/tsconfig.web.md +25 -0
- package/tsconfig.json +29 -0
- package/tsconfig.node.json +12 -0
- package/tsconfig.vitest.json +9 -0
- package/tsconfig.web.json +20 -0
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@allkit/tsconfig",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "A base TSConfig for working with allkit",
|
|
5
|
+
"author": "SPig",
|
|
6
|
+
"main": "tsconfig.json",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"keywords": [
|
|
9
|
+
"vue",
|
|
10
|
+
"mid",
|
|
11
|
+
"tsconfig"
|
|
12
|
+
],
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"@types/node": "*"
|
|
18
|
+
}
|
|
19
|
+
}
|
package/skill/SKILL.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tsconfig
|
|
3
|
+
description: TypeScript 配置文件,确保类型安全和更好的开发体验 / TypeScript configuration for type safety
|
|
4
|
+
author: allkit
|
|
5
|
+
category: tooling
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# @allkit/tsconfig
|
|
9
|
+
|
|
10
|
+
TypeScript 配置文件,确保类型安全和更好的开发体验。
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm add -D typescript @allkit/tsconfig
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Configurations
|
|
19
|
+
|
|
20
|
+
| Name | Description |
|
|
21
|
+
|------|-------------|
|
|
22
|
+
| [tsconfig.web](./references/tsconfig.web.md) | Web 应用配置 |
|
|
23
|
+
| [tsconfig.node](./references/tsconfig.node.md) | Node.js 配置 |
|
|
24
|
+
| [tsconfig.vitest](./references/tsconfig.vitest.md) | Vitest 配置 |
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"extends": "@allkit/tsconfig/tsconfig.web.json"
|
|
31
|
+
}
|
|
32
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# tsconfig.web.json
|
|
2
|
+
|
|
3
|
+
Web 应用 TypeScript 配置
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Target: ES2020
|
|
8
|
+
- Module: ESNext
|
|
9
|
+
- JSX: preserve
|
|
10
|
+
- Strict mode enabled
|
|
11
|
+
- Path aliases support
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"extends": "@allkit/tsconfig/tsconfig.web.json",
|
|
18
|
+
"compilerOptions": {
|
|
19
|
+
"baseUrl": ".",
|
|
20
|
+
"paths": {
|
|
21
|
+
"@/*": ["src/*"]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
|
|
6
|
+
"sourceMap": false,
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
|
|
10
|
+
"jsx": "preserve",
|
|
11
|
+
"jsxImportSource": "vue",
|
|
12
|
+
|
|
13
|
+
"allowJs": true,
|
|
14
|
+
"verbatimModuleSyntax": true,
|
|
15
|
+
|
|
16
|
+
"esModuleInterop": true,
|
|
17
|
+
"moduleResolution": "bundler",
|
|
18
|
+
"resolveJsonModule": true,
|
|
19
|
+
|
|
20
|
+
"forceConsistentCasingInFileNames": true,
|
|
21
|
+
"skipLibCheck": true,
|
|
22
|
+
"noUnusedLocals": true,
|
|
23
|
+
"noUnusedParameters": true,
|
|
24
|
+
"noImplicitThis": true,
|
|
25
|
+
"noImplicitAny": true,
|
|
26
|
+
"noImplicitReturns": true,
|
|
27
|
+
"allowSyntheticDefaultImports": true
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"lib": [
|
|
5
|
+
// Target ES2020 to align with Vite.
|
|
6
|
+
// <https://vite.dev/config/build-options.html#build-target>
|
|
7
|
+
// Support for newer versions of language built-ins are
|
|
8
|
+
// left for the users to include, because that would require:
|
|
9
|
+
// - either the project doesn't need to support older versions of browsers;
|
|
10
|
+
// - or the project has properly included the necessary polyfills.
|
|
11
|
+
"ES2020",
|
|
12
|
+
|
|
13
|
+
"DOM",
|
|
14
|
+
"DOM.Iterable"
|
|
15
|
+
// No `ScriptHost` because Vue 3 dropped support for IE
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"types": []
|
|
19
|
+
|
|
20
|
+
}
|