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

"editor.formatOnSave": true does not respect "files": { "ignore": ["example.ts"] },🐛 #189

Closed
1 of 3 tasks
jsolly opened this issue Apr 2, 2024 · 10 comments
Closed
1 of 3 tasks
Labels
Waiting for response Waiting for a response from the author of the issue

Comments

@jsolly
Copy link

jsolly commented Apr 2, 2024

VS Code version

1.87.2

Extension version

2.2.2

Biome version

1.5.3

Operating system

  • Windows
  • macOS
  • Linux

Description

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

Steps to reproduce

Follow the Biome.js docs and add an ignore rule to your biome.json file.

biome.json

{
  "files": {
    "ignore": ["scripts/*.js"]
  }
}

2 - Edit your vscode settings to turn on 'format on save'. With this turned on, formatting should be performed any time you save a file.

vscode setting file

"settings": {
    "editor.formatOnSave": true,
}

3 - Add some JavaScript files to /scripts
4 - Make some edits and save the file
The files are formatted even though they are in the ignore list.

Expected behavior

If you run biome.js in the terminal, e.g. pnpm run lint the files are NOT formatted. This is how I think the extension should work, too.

Does this issue occur when using the CLI directly?

No

Logs

No response

@jsolly jsolly added the Triage label Apr 2, 2024
@jsolly
Copy link
Author

jsolly commented Apr 2, 2024

I found this closed issue which appears to be an duplicate, but I just tried this out on the pre-release version and can still reproduce my issue.

v2024.3.70509 (pre-release)

I know this is a Biome.js extension issue because it goes away if I disable/uninstall the extension.

@Sec-ant
Copy link
Member

Sec-ant commented Apr 3, 2024

The latest version of biome (not the extension) is 1.6.3 (and 1.6.4 soon), could you try the latest one?

@Sec-ant Sec-ant added Waiting for response Waiting for a response from the author of the issue and removed Triage labels Apr 3, 2024
@jsolly
Copy link
Author

jsolly commented Apr 3, 2024

@Sec-ant that fixed it. Should have thought of that!

1.6.3 Biome.js version resolves the issue.

@jsolly jsolly closed this as completed Apr 3, 2024
@jrson83
Copy link

jrson83 commented Apr 18, 2024

I'm having the same issue with formatter using version 1.7.0.

@vktrl
Copy link

vktrl commented May 3, 2024

Same here.

Extension 2.2.2
Biome 1.7.2

@jrson83
Copy link

jrson83 commented May 3, 2024

@Sec-ant guess you could reopen this? If you need any more info or a reproducable example let me know.

@ematipico
Copy link
Member

Can anyone create a small reproduction?

@jrson83
Copy link

jrson83 commented May 3, 2024

Can anyone create a small reproduction?

Yes, I will do now.

@jrson83
Copy link

jrson83 commented May 3, 2024

@Sec-ant @ematipico @vktrl after investigating I opened a new issue with reproduction example, since my is related to formatter.ignore.

@vktrl
Copy link

vktrl commented May 4, 2024

Can anyone create a small reproduction?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting for response Waiting for a response from the author of the issue
Projects
None yet
Development

No branches or pull requests

5 participants