docs: 添加tsconfig.json注释
This commit is contained in:
parent
86566b6708
commit
9009e48518
@ -22,6 +22,7 @@ import "@/assets/fonts/fonts.scss";
|
|||||||
// 引入自定义指令
|
// 引入自定义指令
|
||||||
import directives from "@/directives/index";
|
import directives from "@/directives/index";
|
||||||
|
|
||||||
|
// vchart黑暗模式
|
||||||
// https://arco.design/react/docs/vchart
|
// https://arco.design/react/docs/vchart
|
||||||
initVChartArcoTheme();
|
initVChartArcoTheme();
|
||||||
|
|
||||||
|
|||||||
@ -1,29 +1,32 @@
|
|||||||
{
|
{
|
||||||
|
// 编译选项
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2020",
|
"target": "ES2020", // 指定ECMAScript目标版本
|
||||||
"useDefineForClassFields": true,
|
"useDefineForClassFields": true,
|
||||||
"module": "ESNext",
|
"module": "ESNext", // 设置程序的模块系统
|
||||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
"lib": ["ES2020", "DOM", "DOM.Iterable"], //TS需要引用的库,即声明文件,es5 默认引用dom、es5、scripthost,如需要使用es的高级版本特性,通常都需要配置,如es8的数组新特性需要引入"ES2019.Array",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true, //忽略所有的声明文件( *.d.ts)的类型检查
|
||||||
|
|
||||||
/* Bundler mode */
|
/* Bundler mode */
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler", //模块解析策略。默认使用node的模块解析策略
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true, //允许导入扩展名为".json"的模块
|
||||||
"isolatedModules": true,
|
"isolatedModules": true, //将每个文件作为单独的模块(与"ts.transpileModule"类似)。
|
||||||
"noEmit": true,
|
"noEmit": true, // 不输出文件,即编译后不会生成任何js文件
|
||||||
"jsx": "preserve",
|
"jsx": "preserve", //preserve模式,在preserve模式下生成代码中会保留JSX以供后续的转换操作使用
|
||||||
|
|
||||||
/* Linting */
|
/* Linting */
|
||||||
"strict": true,
|
"strict": true, //启用所有严格类型检查选项
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true, // 若有未使用的局部变量则抛错
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true, // 检若有未使用的函数参数则抛错
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true, // 防止switch语句贯穿(即如果没有break语句后面不会执行)
|
||||||
"baseUrl": "./",
|
"baseUrl": "./", // 解析非相对模块的基地址,默认是当前目录
|
||||||
"paths": {
|
"paths": {
|
||||||
|
// 模块名到基于 baseUrl的路径映射的列表
|
||||||
"@/*": ["src/*"]
|
"@/*": ["src/*"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// include也可以指定要编译的路径列表,这里的路径可以是文件夹,也可以是文件,可以使用相对和绝对路径,而且可以使用通配符,比如"./src"即表示要编译src文件夹下的所有文件以及子文件夹的文件
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
"src/**/*.ts",
|
"src/**/*.ts",
|
||||||
@ -32,6 +35,7 @@
|
|||||||
"vite.config.ts",
|
"vite.config.ts",
|
||||||
"src/auto-import.d.ts" // 与vite.config.ts中的dts路径一致
|
"src/auto-import.d.ts" // 与vite.config.ts中的dts路径一致
|
||||||
], // 指定被编译文件所在的目录
|
], // 指定被编译文件所在的目录
|
||||||
|
// exclude表示要排除的、不编译的文件,它也可以指定一个列表,规则和include一样,可以是文件或文件夹,可以是相对路径或绝对路径,可以使用通配符
|
||||||
"exclude": ["node_modules", "dist", "**/*.js"], // 指定不需要被编译的目录
|
"exclude": ["node_modules", "dist", "**/*.js"], // 指定不需要被编译的目录
|
||||||
"references": [{ "path": "./tsconfig.node.json" }]
|
"references": [{ "path": "./tsconfig.node.json" }]
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user