noEmptyInterface
Ta treść nie jest jeszcze dostępna w Twoim języku.
Summary
Section titled “Summary”- Rule available since: 
v1.0.0 - Diagnostic Category: 
lint/suspicious/noEmptyInterface - This rule is recommended, which means is enabled by default.
 - This rule has a safe fix.
 - The default severity of this rule is error.
 - Sources:
- Inspired from 
@typescript-eslint/no-empty-interface 
 - Inspired from 
 
How to configure
Section titled “How to configure”{  "linter": {    "rules": {      "suspicious": {        "noEmptyInterface": "error"      }    }  }}Description
Section titled “Description”Disallow the declaration of empty interfaces.
An empty interface in TypeScript does very little: any non-nullable value is assignable to {}.
Using an empty interface is often a sign of programmer error, such as misunderstanding the concept of {} or forgetting to fill in fields.
The rule ignores empty interfaces that extends one or multiple types.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”interface A {}code-block.ts:1:1 lint/suspicious/noEmptyInterface  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ An empty interface is equivalent to {}.
  
  > 1 │ interface A {}
      │ ^^^^^^^^^^^^^^
    2 │ 
  
  ℹ Safe fix: Use a type alias instead.
  
    1   │ - interface·A·{}
      1 │ + type·A·=·{}
    2 2 │   
  
interface A {  prop: string;}
// Allow empty interfaces that extend a type.interface B extends A {}
// Allow empty interfaces in ambient modulesdeclare module "mod" {  interface C {}}Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.