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

Generate d.ts per svg file #950

Open
aspirisen opened this issue Mar 21, 2024 · 0 comments
Open

Generate d.ts per svg file #950

aspirisen opened this issue Mar 21, 2024 · 0 comments

Comments

@aspirisen
Copy link

🚀 Feature Proposal

Add feature to generate typescript declaration file per svg file. So you can import svg directly and with path intellisense and ts validation for that svg file.

Motivation

Current approach is to create module declaration for any svg file. That makes typescript not to validate import path at all. In addition this enforces developers creating index file for all icons and constantly keep up to date with manual control.

Generating d.ts file nearby svg icon will help to avoid possible mistakes and improve IDE support.

Example

As another improvement will be using rootDirs from typescript. User can generate d.ts in another folder under gitignore, but with rootDirs you still have TS support and the project files tree is not poluted with d.ts files.

Pitch

SVGR already generate typescript files, so generating d.ts is close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant