I have the following function in typescript:
export function normalizeUrl(url: string | String | URL) {
When running eslint (with eslint.configs.recommended
and tseslint.configs.recommended
rulesets only) this statement gets changed to
export function normalizeUrl(url: string | string | URL) {
How do I prevent String
being converted to string
?
I’ve tried disabling https://eslint.org/docs/latest/rules/no-new-wrappers
globally but it has no effect. I can’t find any other options that look relevant.
Note: This is for a package I maintain and users have requested in the past that I support passing in string objects, so I don’t have the option of only accepting string primitives.