rollup-plugin-dts
rollup-plugin-dts copied to clipboard
refactor: minor improvements
I acknowledge that this project is in maintenance mode, but I think it could still benefit from some minor improvements:
-
Use
const
instead oflet
when possible.- It makes the code more easy to read, plus it can help to avoid potential future bugs.
- Although it can worsen performance for one-time executions, it does the opposite for code that executes a sufficient number of times (which is likely when working on large projects).
-
Use
node:*
imports instead of "unqualified" imports for intrinsic modules.- They have been supported since Node v14.18, which is already marked as not supported.
- These imports can help to avoid potential module naming conflicts and the associated risks.
-
Mark types imports as such (available since TS v3.8)
-
Use "normal" strings instead of interpolated strings when no variables are interpolated.
-
Use
===
comparisons where it makes sense (instead of==
) -
Minor fixes on some return types