Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compileOptions in deno.json donesn't support types, however the documentation says, types is supported #23319

Open
Mqxx opened this issue Apr 11, 2024 · 1 comment
Assignees
Labels
needs investigation requires further investigation before determining if it is an issue or not

Comments

@Mqxx
Copy link

Mqxx commented Apr 11, 2024

Version: deno 1.42.2 (release, x86_64-pc-windows-msvc)

I tried to specify a .d.ts file in the compilerOptions in types in deno.json, but the file was not recognized/loaded. It looks like Deno would just ignore the types entry in the compilerOptions. The Deno manual however says that I can specify types inside compilerOptions in the config file: docs.deno.com/runtime/manual/advanced/typescript/configuration#using-the-types-property

All of these files are in the root of my project:

index.d.ts

declare module '*.scss' {
  const content: string;
  export default content;
}

deno.json

{
  "compilerOptions": {
    "types": [ //<-- Doesn't even get suggested for autocomplete 
      "./index.d.ts"
    ]
  }
}

styles.scss

body {
  color: red;
}

main.ts

import styles from './styles.scss'
    // ^
    // Error: Module '"file:///D:/path/to/style.scss"' has no default export. deno-ts(1192)

However, writing // @deno-types="./index.d.ts" above the import removes at least the error. But I don't want to write this over every .scss file that I want to import.

@Mqxx Mqxx changed the title compileOptions in deno.json donesnt support types, however the documentation says, types` is supported compileOptions in deno.json donesn't support types, however the documentation says, types is supported Apr 11, 2024
@lucacasonato lucacasonato added the needs investigation requires further investigation before determining if it is an issue or not label Jun 8, 2024
@Mqxx
Copy link
Author

Mqxx commented Sep 18, 2024

Documentation got updated. The configuration still says that types can be specified inside compilerOptions.

https://docs.deno.com/runtime/reference/ts_config_migration/#suppling-%22types%22-in-deno.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation requires further investigation before determining if it is an issue or not
Projects
None yet
Development

No branches or pull requests

4 participants