Closed aakagi closed 2 months ago
@aakagi What kind of use do you want to make of it?
*.scss.d.ts
files generated locally, for local type-safety while developing.*.scss.d.ts
to my .gitignore
.It would be nice to be able to run a command like this to check type safety:
# Generate types
yarn vite-plugin-sass-dts # [--args]
# Check type safety
yarn tsc
Is it easy to add a command like this?
Understood, I'll see what I can do.
@aakagi
I'll need a configuration file for execution in cli, but I'm not sure.
I figured out a solution that works!
I wrote a script that checks to make sure each .module.scss
file has a sibling .module.scss.d.ts
file, and throws an error if it doesn't, or if a "rogue" one is found.
The script I wrote also allows you to pass in a --fix
flag which updates the file timestamp for .module.scss
files that are missing a sibling .module.scss.d.ts
file, which then causes vite-plugin-sass-dts
to generate the file 😄. The --fix
flag will also delete any "rogue" .module.scss.d.ts
files that are found.
You can read through the full implementation here: https://gist.github.com/aakagi/d0c9954b1ec617b9b6ab150d7d78a892
Is there a way to generate the type definitions only in CI?
I would prefer to
.gitignore
the files locally and re-generate them in CI. Is this possible to do?