ember-intl
ember-intl copied to clipboard
This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.
- [x] I am on the latest ember-intl version
- [x] I have searched the issues of this repo and believe that this is not a duplicate
Environment
-
Ember Version: 3.25.x
-
Ember CLI Version: 3.25.x
-
Ember Intl Version: 5.6.2
-
Browser(s): n/a
-
Node Version: n/a
-
TypeScript: 4.2.4
-
Using composite TS configs
- not even sure which project in the monorepo is causing this, because this is the sole error
Steps to Reproduce
Not sure yet, but here is what I'm getting:
tsc --build --clean && tsc --build
node_modules/ember-intl/addon/-private/formatters/-base.ts:8:1 - error TS1371: This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.
8 import { Formats } from '../../types';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error.
Here is the referenced code: https://github.com/ember-intl/ember-intl/blob/main/addon/-private/formatters/-base.ts#L7
and the error makes sense. The import should be import type { Formats } ..., but I don't yet know why it even matters since its in node_modules, and importsNotUsedAsValues is a project-level setting?
I've just merged @hadiwina's PR #1635. Thanks for the contribution.
And thanks @NullVoxPopuli for getting my attention in the Discord.
Unfortunately main is already headed for v6.x. I'd like to backport the fix to v5.x, however there's currently a bit of confusion around the two latest versions v5.7.1 / v5.7.2, as further discussed here: https://github.com/ember-intl/ember-intl/issues/1631#issuecomment-1017900383
I'm not sure right now, where to base the backport on. Once this is resolved, I'll cut another v5.x release.
@buschtoens I found another potential similar issue here. I think that this is also supposed to be import type { Formats, Translations }?
I'll find some time today or tomorrow to open another PR.
I'm doing some issue gardening 🌱🌿 🌷 and came upon this issue. Since it's quite old I just wanted to ask if this is still relevant? If it isn't, maybe we can close this issue?
By closing some old issues we reduce the list of open issues to a more manageable set.
If this is fixed in 6.0, maybe just drop this and focus on the new release.
Looks resolved in https://github.com/ember-intl/ember-intl/pull/1696/files