Skip to content

[4.5.3][4.6.0-20211212] wrong diagnostic on specifier-specific "type" and importsNotUsedAsValues="error"Β #47118

@AviVahl

Description

@AviVahl

Bug Report

πŸ”Ž Search Terms

importsNotUsedAsValues

πŸ•— Version

4.5.3, when specifier-specific type keyword was added.

⏯ Playground Link

The playground doesn't allow setting importsNotUsedAsValues

πŸ’» Code

// this works

import type { VFC } from 'react';
export const Hello: VFC<{}> = () => <main>Hello World</main>;

and:

// this reports diagnostics

import { type VFC } from 'react';
export const Hello: VFC<{}> = () => <main>Hello World</main>;

should behave the same (no error)

πŸ™ Actual behavior

This import is never used as a value and must use 'import type' because 'importsNotUsedAsValues' is set to 'error'.ts(1371) on second piece of code.

πŸ™‚ Expected behavior

Both examples should not report diagnostics.

@andrewbranch I feel like this is your cup of tea. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions