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
I'm using using eslint-plugin-import v2.31.0, eslint v9.18.0 and typescript v5.5.4
configuration for the plugin: import/no-duplicates is ['error', { 'prefer-inline': true }].
I have an npm package that has both type definitions (type or interfaces) and const enum-s,
for example:
When I am trying to import both, an interface and enum - eslint complains that it must be in one line, like this:
import{typeSomething,SomeEnum}from'some-package';
but typescript can't compile such typescript file, fails with error: "Error: Module not found: Error: Can't resolve 'some-package'"
there is an issue in typescript repo about this problem, but it is very old and it seems it will not be resolved in near future: microsoft/TypeScript#40344
for now I will have to have such imports in 2 lines:
and I will have to set 'prefer-inline' to false, but would be cool to be able to have those 2 lines only for the const enum-s and not for all other imports.
The text was updated successfully, but these errors were encountered:
Hmm, that's confusing - enums (which should be avoided anyways, for many reasons) are both a type and a value, so I'm not sure why you wouldn't be able to use the inline form.
I'm using using eslint-plugin-import v2.31.0, eslint v9.18.0 and typescript v5.5.4
configuration for the plugin:
import/no-duplicates
is['error', { 'prefer-inline': true }]
.I have an npm package that has both type definitions (
type
orinterfaces
) andconst enum
-s,for example:
When I am trying to import both, an interface and enum - eslint complains that it must be in one line, like this:
but typescript can't compile such typescript file, fails with error:
"Error: Module not found: Error: Can't resolve 'some-package'"
there is an issue in typescript repo about this problem, but it is very old and it seems it will not be resolved in near future:
microsoft/TypeScript#40344
for now I will have to have such imports in 2 lines:
and I will have to set
'prefer-inline'
tofalse
, but would be cool to be able to have those 2 lines only for theconst enum
-s and not for all other imports.The text was updated successfully, but these errors were encountered: