fix(common): Remove unused import (#9387)

Moving the import under the tty-emitter feature fixes the following:

    warning: unused import: `IsTerminal`
      --> /home/user/swc/crates/swc_common/src/errors/emitter.rs:15:28
       |
    15 |     io::{self, prelude::*, IsTerminal},
       |                            ^^^^^^^^^^
       |
       = note: `#[warn(unused_imports)]` on by default

---------

Co-authored-by: Donny/강동윤 <kdy1997.dev@gmail.com>
This commit is contained in:
Alex Crawford 2024-08-06 20:15:48 -07:00 committed by GitHub
parent 4e854c7996
commit f5304761b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,6 @@
---
swc_common: patch
swc_core: patch
---
fix(common): Remove unused import

View File

@ -12,7 +12,7 @@ use std::{
borrow::Cow,
cmp::{min, Reverse},
collections::HashMap,
io::{self, prelude::*, IsTerminal},
io::{self, prelude::*},
};
#[cfg(feature = "tty-emitter")]
@ -116,6 +116,8 @@ pub enum ColorConfig {
impl ColorConfig {
#[cfg(feature = "tty-emitter")]
fn to_color_choice(self) -> ColorChoice {
use std::io::IsTerminal;
let stderr = io::stderr();
match self {