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

🐛 biome processing .vscode/*.txt that it shouldn't #4391

Closed
1 task done
unional opened this issue Oct 26, 2024 · 6 comments · Fixed by #4595
Closed
1 task done

🐛 biome processing .vscode/*.txt that it shouldn't #4391

unional opened this issue Oct 26, 2024 · 6 comments · Fixed by #4595
Assignees
Labels
A-CLI Area: CLI L-JSON Language: JSON and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@unional
Copy link

unional commented Oct 26, 2024

Environment information

CLI:
  Version:                      1.9.4
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_PATH:               unset
  BIOME_LOG_PREFIX_NAME:        unset
  BIOME_CONFIG_PATH:            unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.18.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/9.12.2"

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

Workspace:
  Open Documents:               0

What happened?

It is scanning and processing .txt file it shouldn't.

https://github.com/repobuddy/storybook-addon-vis/tree/biome-txt

pnpm i
pnpm check

The repo above has ignored any addition configs that doesn't matter already.

Expected result

no error

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@unional unional added the S-Needs triage Status: this issue needs to be triaged label Oct 26, 2024
@ematipico
Copy link
Member

What kind of error does Biome output?

@unional
Copy link
Author

unional commented Oct 26, 2024

Things like string should be in qoutes.
Seems like biome is treating them like js/ts/json file

@ematipico
Copy link
Member

Is it possible that your editor is mapping those files to another language?

Is it possible that there's an extension that does that?

To make sure it's Biome and not something in your editor, always use the CLI.

@unional
Copy link
Author

unional commented Oct 26, 2024

It is cli, not ide

@ematipico ematipico added A-CLI Area: CLI L-JSON Language: JSON and super languages S-Bug-confirmed Status: report has been confirmed as a valid bug and removed S-Needs triage Status: this issue needs to be triaged labels Oct 26, 2024
@ematipico
Copy link
Member

It seems those files are parsed as JSON files

@ematipico
Copy link
Member

@Conaclos could you please a look at this issue?

I found the bug, the function that pull the known JSON files is incorrectly assuming that all files inside the known folders are JSON files:

        if let Some(Component::Normal(parent_dir)) = path.components().rev().nth(1) {
            if Self::is_well_known_json_allow_comments_directory(parent_dir) {
                return Ok(Self::json_allow_comments());
            }
        }

This is incorrect, it seems, and we should still look at the extension of the file.

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