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

馃悰 formatOnSave does not respect formatter.ignore #2781

Closed
2 of 3 tasks
jrson83 opened this issue May 3, 2024 · 5 comments 路 Fixed by #2939
Closed
2 of 3 tasks

馃悰 formatOnSave does not respect formatter.ignore #2781

jrson83 opened this issue May 3, 2024 · 5 comments 路 Fixed by #2939
Assignees
Labels
A-LSP Area: language server protocol A-Project Area: project S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@jrson83
Copy link

jrson83 commented May 3, 2024

VS Code version

1.89.0

Extension version

2.2.2

Biome version

1.7.2

Operating system

  • Windows
  • macOS
  • Linux

Description

This issue is identical to biomejs/biome-vscode#189 which has been fixed for files.ignore.


If 'format on save' is turned on, using formatter.ignore the Biome.js extension will format files that should be ignored.

// .vscode/settings.json
"settings": {
  "editor.formatOnSave": true
}

Using files.ignore the issue is fixed.

// biome.json
{
  "files": {
    "ignore": ["node_modules", "no-format.js"]
  }
}

Using formatter.ignore the issue still persists.

// biome.json
{
  "formatter": {
    "ignore": ["node_modules", "no-format.js"]
  }
}

Steps to reproduce

  1. Clone the repo:
git clone https://github.com/jrson83/biome-ignore-issue.git
cd biome-ignore-issue
pnpm install
  1. Open packages/core/src/no-format.js and save the file, you see it formats.

Expected behavior

  1. Since the issue is identical to "editor.formatOnSave": true does not respect "files": { "ignore": ["example.ts"] },馃悰 聽biome-vscode#189 which has been fixed for files.ignore, I expect the same behaviour using formatter.ignore.
  2. If you run biome.js in the terminal, e.g. pnpm run format the files are NOT formatted.

Does this issue occur when using the CLI directly?

No

Logs

No response

@nhedger
Copy link
Member

nhedger commented May 9, 2024

Moving this to the main repo, because it appears to be related to the LSP.

@nhedger nhedger pinned this issue May 9, 2024
@nhedger nhedger unpinned this issue May 9, 2024
@nhedger nhedger transferred this issue from biomejs/biome-vscode May 9, 2024
@nhedger nhedger added the A-LSP Area: language server protocol label May 9, 2024
@ematipico
Copy link
Member

Reproduction: https://github.com/vktrl/biome-vscode-ignore-bug

@ematipico ematipico added A-Project Area: project S-Bug-confirmed Status: report has been confirmed as a valid bug labels May 20, 2024
@ematipico
Copy link
Member

The reproduction #2781 (comment) isn't valid, because it relies on nested biome.json files, which aren't supported.

@jrson83 can you provide a minimal reproduction?

@ematipico ematipico added S-Needs repro Status: needs a reproduction and removed S-Bug-confirmed Status: report has been confirmed as a valid bug labels May 21, 2024
@jrson83
Copy link
Author

jrson83 commented May 21, 2024

@ematipico see the actual issue above I already provided an example:

git clone https://github.com/jrson83/biome-ignore-issue.git
cd biome-ignore-issue
pnpm install

@ematipico
Copy link
Member

Thank you

@ematipico ematipico added S-Bug-confirmed Status: report has been confirmed as a valid bug and removed S-Needs repro Status: needs a reproduction labels May 21, 2024
@ematipico ematipico self-assigned this May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LSP Area: language server protocol A-Project Area: project 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.

3 participants