选项importsNotUsedAsValues已弃用



有人能帮我这个jsonfig.json文件为一个苗条的项目?这是说importsNotUsedAsValues选项应该替换为verbatimModuleSyntax

{
"compilerOptions": {
"moduleResolution": "Node",
"target": "ESNext",
"module": "ESNext",
/**
* svelte-preprocess cannot figure out whether you have
* a value or a type, so tell TypeScript to enforce using
* `import type` instead of `import` for Types.
*/
"importsNotUsedAsValues": "error",
"isolatedModules": true,
"resolveJsonModule": true,
/**
* To have warnings / errors of the Svelte compiler at the
* correct position, enable source maps by default.
*/
"sourceMap": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
/**
* Typecheck JS in `.svelte` and `.js` files by default.
* Disable this if you'd like to use dynamic types.
*/
"checkJs": true
},
/**
* Use global.d.ts instead of compilerOptions.types
* to avoid limiting type declarations.
*/
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
}

完整的错误信息是

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

根据veratimmodulesyntax代替

"importsNotUsedAsValues": "error"

你应该使用

"verbatimModuleSyntax": true

查看拉取请求中的详细信息。

相关内容

  • 没有找到相关文章

最新更新