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
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,50 @@ declare_oxc_lint!(
/// The two are generally very similar, and can often be used interchangeably.
/// Using the same type declaration style consistently helps with code readability.
///
/// ### Example
/// ```ts
/// // incorrect, when set to "interface"
/// ### Examples
///
/// By default this rule enforces the use of interfaces for object types.
///
/// Examples of **incorrect** code for this rule:
/// ```typescript
/// type T = { x: number };
/// ```
///
/// Examples of **correct** code for this rule:
/// ```typescript
/// type T = string;
/// type Foo = string | {};
///
/// interface T {
/// x: number;
/// }
/// ```
///
/// ### Options
///
/// // incorrect when set to "type"
/// This rule has a single string option:
///
/// `{ type: string, default: "interface" }`
///
/// ### interface
///
/// This is the default option.
///
/// ### type
///
/// Enforces the use of types for object type definitions.
///
/// Examples of **incorrect** code for this option:
/// ```typescript
/// interface T {
/// x: number;
/// x: number;
/// }
/// ```
///
/// Examples of **correct** code for this option:
/// ```typescript
/// type T = { x: number };
/// ```
ConsistentTypeDefinitions,
typescript,
style,
Expand Down
Loading