vue3项目中的一些报错

发布时间 2023-11-28 00:25:54作者: MattMaster

问题简介 关于typeScript编译配置问题

"importsNotUsedAsValues"选项已被弃用,并将在TypeScript 5.5中停止使用。要消除此错误,
请指定compilerOption '"ignoreDeprecations": "5.0"'。请改用'verbatimModuleSyntax'。

这段文本提到了TypeScript编译器配置文件的JSON模式,其中说明了"importsNotUsedAsValues"选项已被弃用,
并且在TypeScript 5.5版本中将停止使用。为了消除此错误,建议在配置文件中添加compilerOption '"ignoreDeprecations": "5.0"'。同时,
建议使用'verbatimModuleSyntax'选项作为替代方案。

Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5.
 Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. 
Use 'verbatimModuleSyntax' instead.ts Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. 
Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. 
Use 'verbatimModuleSyntax' instead.ts JSON schema for the TypeScript compiler's configuration file

解决方式

  1- 在tsconfig.json文件中 
    在compilerOptions中 添加
    "ignoreDeprecation":"5.0"

  2 在tsconfig.config.json文件中
    在compilerOptions中添加
    "ignoreDeprecation":"5.0"

  3 重启项目 解决文件报红问题