diff --git a/crates/oxc_linter/src/rules/import/no_duplicates.rs b/crates/oxc_linter/src/rules/import/no_duplicates.rs index 56f8dcba0236a..fd5b9a5b65024 100644 --- a/crates/oxc_linter/src/rules/import/no_duplicates.rs +++ b/crates/oxc_linter/src/rules/import/no_duplicates.rs @@ -5,6 +5,7 @@ use oxc_diagnostics::{LabeledSpan, OxcDiagnostic}; use oxc_macros::declare_oxc_lint; use oxc_span::Span; use rustc_hash::FxHashMap; +use schemars::JsonSchema; use crate::{ context::LintContext, @@ -36,8 +37,16 @@ where } /// -#[derive(Debug, Default, Clone)] +#[derive(Debug, Default, Clone, JsonSchema)] +#[serde(rename_all = "camelCase", default)] pub struct NoDuplicates { + /// When set to `true`, prefer inline type imports instead of separate type import + /// statements for TypeScript code. + /// + /// Examples of **correct** code with this option set to `true`: + /// ```typescript + /// import { Foo, type Bar } from './module'; + /// ``` prefer_inline: bool, } @@ -76,7 +85,8 @@ declare_oxc_lint!( /// ``` NoDuplicates, import, - style + style, + config = NoDuplicates, ); impl Rule for NoDuplicates {