Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Mar 30, 2023
1 parent e8d73f7 commit e919334
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Expand Up @@ -26,19 +26,19 @@ const invalids = [
],
[
'const foo = <K, T extends Boolean>(as: string, bar: number): Omit<T, K> => as + bar',
'function foo <K, T extends Boolean>(as: string, bar: number): Omit<T, K> { return as + bar }',
'function foo <K, T extends Boolean>(as: string, bar: number): Omit<T, K> {\n return as + bar\n}',
],
[
'export const foo = () => {}',
'export function foo () {}',
],
[
'export const foo = () => ({})',
'export function foo () { return {} }',
'export function foo () {\n return {}\n}',
],
[
'export const foo = async () => ({})',
'export async function foo () { return {} }',
'export async function foo () {\n return {}\n}',
],
]

Expand Down
Expand Up @@ -60,7 +60,7 @@ export default createEslintRule<Options, MessageIds>({
: ''
const textBody = body.type === 'BlockStatement'
? code.slice(body.range[0], body.range[1])
: `{ return ${code.slice(body.range[0], body.range[1])} }`
: `{\n return ${code.slice(body.range[0], body.range[1])}\n}`
const textGeneric = arrowFn.typeParameters
? code.slice(arrowFn.typeParameters.range[0], arrowFn.typeParameters.range[1])
: ''
Expand Down

0 comments on commit e919334

Please sign in to comment.