typed-scss-modules icon indicating copy to clipboard operation
typed-scss-modules copied to clipboard

No typesafety with module path aliases

Open 18anandn opened this issue 1 year ago • 1 comments

Importing scss modules using module path aliases does not give typesafety if type declarations are put in a seperate output folder.

// Works
import styles from "../styles/Home.module.scss";

// Does not work
import styles from "@/styles/Home.module.scss";

Expected Behavior

Type safety should be present when using module path aliases and type definitions are put in a seprate output folder.

Current Behavior

No typesafety when using module path aliases and type definitions are put in a seprate output folder.

Possible Solution

Maybe there is some tsconfig setting that I am missing.

Steps to Reproduce (for bugs)

Codesandbox link

Your Environment

Using Typescript Workspace version 5.4.5

  • Version used: latest as of now
  • Operating System and versions: Ubuntu 22.04

18anandn avatar Apr 28 '24 15:04 18anandn

Right now I get errors when trying to generate .d.ts files from .scss files that use imports with aliases.

I've tried specifying the aliases with the --alias, but that doesn't seem to have any effect—or perhaps I misunderstand how it's supposed to be used.

fuadsaud avatar Sep 26 '24 19:09 fuadsaud