You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
Add deprecated option to allowUnknownClassnames option, in addition to true and false. Alternatively, there can be a new option named unknownClassnamesAsDeprecated.
This option adds JSDoc's @deprecated tag to Typescript index signature in the dts file, so that they are marked differently in IDEs, but not cause errors (e.g. they have strikethrough in VSCode).
Describe alternatives you've considered
I have been using this transformer before:
module.exports=(dts,{ classes, logger })=>{varclassNames=Object.keys(classes);return['/* eslint-disable */','declare let classes: {',' /** @deprecated This class does not exist in the style file */',' [key: string]: string;',` ${classNames.map((x)=>`'${x}': string;`).join('\n ')}`,'};','export default classes;','export const __cssModule: true;',`export type AllClassNames = '${classNames.join("' | '")}';`,].join('\n');};
But it will be hard to maintain this in my codebase from now on since the new options are added (like goToDefinition).
Additional context
An example of how it looks in VSCode:
I can prepare a PR for this if you can decide on which option to use.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
Add
deprecated
option toallowUnknownClassnames
option, in addition totrue
andfalse
. Alternatively, there can be a new option namedunknownClassnamesAsDeprecated
.This option adds JSDoc's
@deprecated
tag to Typescript index signature in the dts file, so that they are marked differently in IDEs, but not cause errors (e.g. they have strikethrough in VSCode).Describe alternatives you've considered
I have been using this transformer before:
But it will be hard to maintain this in my codebase from now on since the new options are added (like
goToDefinition
).Additional context
An example of how it looks in VSCode:
I can prepare a PR for this if you can decide on which option to use.
The text was updated successfully, but these errors were encountered: