codeforpdx / PASS

PASS project - with HMIS module integration
MIT License
25 stars 24 forks source link

Bug: No existing ESLint rules for unused @typedefs in project #471

Open leekahung opened 8 months ago

leekahung commented 8 months ago

Bug Description:

Currently, we're utilizing eslint-plugin-jsdoc for our linting when it comes to JSDoc. However, it does not cover everything such as picking up unused @typedefs. At the moment, the plugin does not have rules for that like it does with no-unused-vars within its configuration, thus people had to manually remove unused @typedefs when found.

Possible Solution (optional):

  1. Found another plugin or library which assists with existing ESLint rules.
  2. Create a custom rule for unused @typedefs
  3. Change syntax for importing typedefs similar to that of importing variables/libraries from other files (See screenshots below)
Screen Shot 2023-10-21 at 15 40 43 Screen Shot 2023-10-21 at 15 44 44
leekahung commented 8 months ago

It looks like we could actually import the typedefs directly from typedefs.js

Screen Shot 2023-10-21 at 15 40 43

If that's the case, think we could open up an PR to change existing imported typedefs which are still utilizing the JSDoc syntax to this format.

Screen Shot 2023-10-21 at 15 44 44
leekahung commented 8 months ago

Never mind. I thought that would help, but this only works for the editor and intellisense. If we were to start this on a dev server, browser would complain.

Screen Shot 2023-10-21 at 17 59 47 (2)