vscode jsconfig.json 使用说明
json
适用于现代 C++ 的 JSON。
项目地址:https://gitcode.com/gh_mirrors/js/json

·
vscode jsconfig.json 使用说明
什么是jsconfig.json
-jsconfig.json文件指定根目录和JavaScript服务提供的功能选项。
- 提示:如果不使用JavaScript,就不需要配置jsconfig.json。
- 提示:tsconfig.json 配置高于 jsconfig.json,它是TypeScript的配置文件。配置了tsconfig.json的情况下 allowJs:true jsconfig.json 才生效。
为什么需要jsconfig.json文件
Visual Studio Code的JavaScript支持可以两种不同模式运行:
- File Scope : 没有jsconfig.json。
在这种模式下,在Visual Studio Code中打开的JavaScript文件被视为独立的单元。只要文件a.js没有显式引用b.ts(即使用import或CommonJS 模块),两个文件之间就不会存在公共项目上下文。 - Explicit Project - 有jsconfig.json。
通过jsconfig.json文件定义一个JavaScript项目。目录中是否存在此类文件表示该目录是JavaScript项目的根目录。文件本身可以选择列出属于项目的文件,要从项目中排除的文件以及编译器选项。
jsconfig选项
选项 | 描述 |
---|---|
noLib | 不包括默认库文件(lib.d.ts) |
target | 指定要使用的默认库(lib.d.ts)。值: es3, es5, es6,es2015,es2016, es2017, es2018, es2019,es2020,esnext |
module | 生成模块代码时指定模块系统。值: amd, commonJS, es2015, es6, esnext, none, system, umd |
moduleResolution | 指定如何解析模块以进行导入。值:node,classic |
checkJs | 对JavaScript文件启用类型检查。 |
experimentalDecorators | 为建议的ES装饰器提供实验支持。 |
allowSyntheticDefaultImports | 允许从模块进行 default import 而没有 default export 。这不影响代码发出,仅影响类型检查。 只起到检查的作用,不会对编译后的代码有任何影响 |
baseUrl | 基本目录,用于解析非相对模块名称。 |
paths | 指定要相对于baseUrl选项计算的路径映射。 |
vue-cli jsconfig 配置
{
"compilerOptions": {
"target": "es2017",
"allowSyntheticDefaultImports": false,
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
}
},
"exclude": ["node_modules", "dist"]
}




适用于现代 C++ 的 JSON。
最近提交(Master分支:4 个月前 )
f06604fc
* :page_facing_up: bump the copyright years
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
* :page_facing_up: bump the copyright years
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
* :page_facing_up: bump the copyright years
Signed-off-by: Niels Lohmann <niels.lohmann@gmail.com>
---------
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
Signed-off-by: Niels Lohmann <niels.lohmann@gmail.com> 30 天前
d23291ba
* add a ci step for Json_Diagnostic_Positions
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* Update ci.cmake to address review comments
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* address review comment
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* fix typo in the comment
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* fix typos in ci.cmake
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* invoke the new ci step from ubuntu.yml
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* issue4561 - use diagnostic positions for exceptions
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* fix ci_test_documentation check
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* address review comments
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* fix ci check failures for unit-diagnostic-postions.cpp
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* improvements based on review comments
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* fix const correctness string
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* further refinements based on reviews
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* add one more test case for full coverage
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* ci check fix - add const
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* add unit tests for json_diagnostic_postions only
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* fix ci_test_diagnostics
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
* fix ci_test_build_documentation check
Signed-off-by: Harinath Nampally <harinath922@gmail.com>
---------
Signed-off-by: Harinath Nampally <harinath922@gmail.com> 30 天前
更多推荐
所有评论(0)