rollup-plugin-dts icon indicating copy to clipboard operation
rollup-plugin-dts copied to clipboard

refactor: minor improvements

Open castarco opened this issue 5 months ago • 0 comments

I acknowledge that this project is in maintenance mode, but I think it could still benefit from some minor improvements:

  • Use const instead of let 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

castarco avatar Sep 19 '24 08:09 castarco