chore: format

This commit is contained in:
Anthony Fu 2023-03-30 10:53:36 +02:00
parent e8d73f737e
commit e9193343e8
2 changed files with 4 additions and 4 deletions

View File

@ -26,7 +26,7 @@ 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 = () => {}',
@ -34,11 +34,11 @@ const invalids = [
],
[
'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}',
],
]

View File

@ -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])
: ''