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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃拝 noExportsInTest treats source code as test files when using in-source testing #2859

Closed
1 task done
chrisvander opened this issue May 14, 2024 · 0 comments 路 Fixed by #2861
Closed
1 task done
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

@chrisvander
Copy link

chrisvander commented May 14, 2024

Environment information

CLI:
  Version:                      1.7.3
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v18.19.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/8.15.4"

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

Linter:
  Recommended:                  true
  All:                          false
  Rules:                        a11y/useValidAnchor = "off"
                                complexity/noForEach = "off"
                                nursery/useSortedClasses = "error"
                                performance/noAccumulatingSpread = "off"
                                style/noNonNullAssertion = "off"

Workspace:
  Open Documents:               0

Rule name

noExportsInTest

Playground link

https://biomejs.dev/playground/?indentStyle=space&files.main.tsx=ZQB4AHAAbwByAHQAIABjAG8AbgBzAHQAIAB0AGUAcwB0ACAAPQAgACIAYQBiAGMAZABlAGYAIgAKAAoAaQBmACAAKABpAG0AcABvAHIAdAAuAG0AZQB0AGEALgB2AGkAdABlAHMAdAApACAAewAKACAAIABjAG8AbgBzAHQAIAB7ACAAZABlAHMAYwByAGkAYgBlACwAIABlAHgAcABlAGMAdAAgAH0AIAA9ACAAaQBtAHAAbwByAHQALgBtAGUAdABhAC4AdgBpAHQAZQBzAHQACgAgACAAZABlAHMAYwByAGkAYgBlACgAIgBhACAAdABlAHMAdAAiACwAIAAoACkAIAA9AD4AIAB7AAoAIAAgACAAIABlAHgAcABlAGMAdAAoAHQAZQBzAHQAKQAuAHQAbwBFAHEAdQBhAGwAKAAiAGEAYgBjAGQAZQBmACIAKQAKACAAIAB9ACkACgB9AAoA

Expected result

When using in-source testing with Vitest, Biome detects those source code files as test files and errors on any exports inside of those files.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@ah-yu ah-yu 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 May 15, 2024
@ah-yu ah-yu self-assigned this May 15, 2024
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
2 participants