2

Could someone help me with this jsonfig.json file for a svelte project? It's saying that the importsNotUsedAsValues option should be replaced with 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"]
}

The full error message is

Option 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5. Specify compilerOption '"ignoreDeprecations": "5.0"' to silence this error. Use 'verbatimModuleSyntax' instead.

Sunny
  • 708
  • 1
  • 4
  • 21
SSFJHGKJFHG
  • 39
  • 1
  • 3
  • And what exactly is the problem? – H.B. Apr 09 '23 at 10:02
  • Does this answer your question? [How to fix "Flag 'importsNotUsedAsValues' is deprecated and will stop functioning in TypeScript 5.5."?](https://stackoverflow.com/questions/75449286/how-to-fix-flag-importsnotusedasvalues-is-deprecated-and-will-stop-functionin) – Dugnom Apr 24 '23 at 09:41

1 Answers1

7

According to the verbatimModuleSyntax instead of

"importsNotUsedAsValues": "error"

You should use

"verbatimModuleSyntax": true

See the details in the pull request.

Damir Tenishev
  • 1,275
  • 3
  • 14