Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💅 noEmptyInterface fix not applicable for ambiant module overloading #959

Closed
1 task done
abustany opened this issue Nov 29, 2023 · 1 comment · Fixed by #1059
Closed
1 task done

💅 noEmptyInterface fix not applicable for ambiant module overloading #959

abustany opened this issue Nov 29, 2023 · 1 comment · Fixed by #1059
Assignees
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@abustany
Copy link

Environment information

CLI:
  Version:                      1.4.0
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.9.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/8.10.2"

Biome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 false

Workspace:
  Open Documents:               0

Rule name

lint/suspicious/noEmptyInterface

Playground link

https://biomejs.dev/playground/?code=aQBuAHQAZQByAGYAYQBjAGUAIABTAGUAcgB2AGkAYwBlAHMAIAB7AAoAIAAgAGgAZQBsAGwAbwA6ACAAcwB0AHIAaQBuAGcAOwAKAH0ACgAKAGQAZQBjAGwAYQByAGUAIABtAG8AZAB1AGwAZQAgACIAQAByAGUAbQBpAHgALQByAHUAbgAvAG4AbwBkAGUAIgAgAHsACgAgACAAZQB4AHAAbwByAHQAIABpAG4AdABlAHIAZgBhAGMAZQAgAEEAcABwAEwAbwBhAGQAQwBvAG4AdABlAHgAdAAgAGUAeAB0AGUAbgBkAHMAIABTAGUAcgB2AGkAYwBlAHMAIAB7AH0ACgB9AAoA

Expected result

The Typescript syntax here is commonly used to allow users to extend existing interfaces in a module. Switching the line to a type alias doesn't work.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@Conaclos Conaclos added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug labels Nov 29, 2023
@Conaclos
Copy link
Member

Conaclos commented Nov 29, 2023

Actually this affects all intreface merging:

export interface B {
  hello: string;
}

export interface A {
  world: string
}

export interface A extends B {}

Altough the previous code is no so useful, because it could be simplified to:

export interface B {
  hello: string;
}

export interface A extends B {
  world: string
}

Thus, we should either fix the code action (for example ignoring interfaces that merge with another one), or make the code fix unsafe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants