Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions crates/oxc_linter/src/rules/import/no_duplicates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -36,8 +37,16 @@ where
}

/// <https://github.com/import-js/eslint-plugin-import/blob/v2.29.1/docs/rules/no-duplicates.md>
#[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,
}

Expand Down Expand Up @@ -76,7 +85,8 @@ declare_oxc_lint!(
/// ```
NoDuplicates,
import,
style
style,
config = NoDuplicates,
);

impl Rule for NoDuplicates {
Expand Down
Loading