enums are not recognized at all when used in combination with checkJS
I'm using JSDoc to make javascript type-safe without all the disadvantages coming with typescript. works pretty well but the problem is now with enums.
a enum we would like to have has some criteria:
- if you enter any value which is not in the range of it, an error is generated
- auto-complete directly offers only the members of the enum
- no raw string input should be supported
but adding the @enum attribute is doing none of this. it's completely useless. the type in the end is still string (if using a string enum), so by now the @enum attribute is completely useless
Input code
/** @enum {string} */
export const enumType = {
member1: 'value1',
member2 'value2'
}Expected behavior
- if you enter any value which is not in the range of it, an error is generated
- auto-complete directly offers only the members of the enum
- no raw string input should be supported
Current behavior
the instances behave exactly like normal strings - no IDE support at all
PS: i'm not sure if this is the right place to post this issue, because you guys might not be just adding the standard and some plugin or VSCode itself is responsible for using it in combination with checkJS if so i would appreciate it if you tell me where this issue should be filed
Source: jsdoc/jsdoc