typed-scss-modules
typed-scss-modules copied to clipboard
No typesafety with module path aliases
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)
Your Environment
Using Typescript Workspace version 5.4.5
- Version used: latest as of now
- Operating System and versions: Ubuntu 22.04
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.