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

馃悰 Suppressing a rule changes formatting in some cases #603

Closed
1 task done
nstepien opened this issue Oct 26, 2023 · 1 comment 路 Fixed by #1764
Closed
1 task done

馃悰 Suppressing a rule changes formatting in some cases #603

nstepien opened this issue Oct 26, 2023 · 1 comment 路 Fixed by #1764
Labels
S-Bug-confirmed Status: report has been confirmed as a valid bug

Comments

@nstepien
Copy link
Sponsor Contributor

nstepien commented Oct 26, 2023

Environment information

CLI:
  Version:                      1.3.1
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         unset
  JS_RUNTIME_VERSION:           "v21.1.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/10.2.1"

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

Workspace:
  Open Documents:               0

What happened?

export function test(arg: any) {
  const a: any = arg;
  return { a };
}

In VSCode, suppress both noExplicitAny issues from the code above

-export function test(arg: any) {
-  const a: any = arg;
+// biome-ignore lint/suspicious/noExplicitAny: <explanation>
+export  function test(arg: any) {
+  // biome-ignore lint/suspicious/noExplicitAny: <explanation>
+const  a: any = arg;
   return { a };
 }

A space was added between export & function, and const & a.
The indentation was also removed from the const a line.

Expected result

Comments are added without changing anything else.
I find it quite distracting that the code shifts around as I add a comment then save to format 馃檭
This is not an issue with ESLint.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@nstepien
Copy link
Sponsor Contributor Author

Have a gif to better demonstrate what I mean:
Recording 2023-11-15 at 21 14 24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

2 participants