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 may break global augmentation #3110

Closed
1 task done
kosmotema opened this issue Jun 7, 2024 · 1 comment · Fixed by #3116
Closed
1 task done

💅 noEmptyInterface may break global augmentation #3110

kosmotema opened this issue Jun 7, 2024 · 1 comment · Fixed by #3116
Assignees
Labels
A-Linter Area: linter L-JavaScript Language: JavaScript and super languages S-Enhancement Status: Improve an existing feature

Comments

@kosmotema
Copy link

kosmotema commented Jun 7, 2024

Environment information

CLI:
  Version:                      1.8.0
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         unset
  JS_RUNTIME_VERSION:           "v18.19.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/9.1.2"

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

Linter:
  JavaScript enabled:           true
  JSON enabled:                 true
  CSS enabled:                  false
  Recommended:                  true
  All:                          false

Workspace:
  Open Documents:               0

Rule name

suspicious/noEmptyInterface

Playground link

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

Expected result

Empty interfaces (which doesn't extend any other interface?) within the declare global block should be ignored from converting them to a type, since the fix will break global augmentation

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@Conaclos
Copy link
Member

Conaclos commented Jun 7, 2024

In the past we enabled empty interface that extends a type in an ambient module (#959).
We could accept any empty interface in an ambient module.

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-Enhancement Status: Improve an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants