-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
📝 arrow function with long type and single param without parens formats to invalid code #1905
Comments
The error occurs due to a line break before the arrow. ref We have two options:
Should we adjust our code to be compatible with Prettier🤔 |
I think what OP is trying to say is the valid code like below will be formatted into invalid code? type InstanceID = string;
type MaybeCardWithAttachment = string;
function outerFunctionToForceIndent() {
const cardWithAttachment: (id: InstanceID) => MaybeCardWithAttachment = (
id
) => {
return `${id}test`;
};
} |
@Sec-ant Nice catch! Maybe I misunderstood. |
sec-ant has it nailed! biome formats the code into TS that doesn't compile, because it's illegal to have |
I am willing to solve this issue~ |
Environment information
Configuration
Issue information
Biome outputs invalid TS; the
=>
is on a new line, that's not valid.Playground link
https://codesandbox.io/p/devbox/biome-starter-cbs-rky6zq
Code of Conduct
The text was updated successfully, but these errors were encountered: