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

🐛 useArrowFunction exception in operator expression ? #1524

Closed
1 task done
noyobo opened this issue Jan 11, 2024 · 0 comments · Fixed by #1527
Closed
1 task done

🐛 useArrowFunction exception in operator expression ? #1524

noyobo opened this issue Jan 11, 2024 · 0 comments · Fixed by #1527
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

@noyobo
Copy link

noyobo commented Jan 11, 2024

Environment information

CLI:
  Version:                      1.5.1
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           macos

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.9.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "npm/10.1.0"

Biome Configuration:
  Status:                       unset

Workspace:
  Open Documents:               0

What happened?

const _setImmediate =  (typeof setImmediate === 'function' &&
function (fn) {
  setImmediate(fn);
}) ||
function (fn) {
  setTimeout(fn, 0);
};

after check --apply

const _setImmediate =  (typeof setImmediate === 'function' &&
(fn) => {
  setImmediate(fn);
}) ||
(fn) => {
  setTimeout(fn, 0);
};

Uncaught SyntaxError: Malformed arrow function parameter list

Expected result

const _setImmediate =  (typeof setImmediate === 'function' &&
((fn) => {
  setImmediate(fn);
})) ||
((fn) => {
  setTimeout(fn, 0);
});

Arrow functions should be wrapped with () ?

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@Conaclos Conaclos 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 Jan 11, 2024
@Conaclos Conaclos self-assigned this Jan 11, 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
Development

Successfully merging a pull request may close this issue.

2 participants