Closed arilotter closed 8 months ago
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. @arilotter Could you provide your input? The playground link you attached seems empty.
@Sec-ant Nice catch! Maybe I misunderstood. @arilotter Could you provide your input? The playground link you attached seems empty.
sec-ant has it nailed! biome formats the code into TS that doesn't compile, because it's illegal to have =>
on its own line.
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