Compare commits

...

2 Commits

Author SHA1 Message Date
Anthony Fu
3963633712 chore: release v0.38.2 2023-03-30 10:53:40 +02:00
Anthony Fu
e9193343e8 chore: format 2023-03-30 10:53:36 +02:00
9 changed files with 11 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config-monorepo",
"version": "0.38.1",
"version": "0.38.2",
"private": true,
"packageManager": "pnpm@8.0.0",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config-basic",
"version": "0.38.1",
"version": "0.38.2",
"description": "",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT",

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config-react",
"version": "0.38.1",
"version": "0.38.2",
"description": "",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT",

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config-ts",
"version": "0.38.1",
"version": "0.38.2",
"description": "",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT",

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config-vue",
"version": "0.38.1",
"version": "0.38.2",
"description": "",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT",

View File

@@ -1,6 +1,6 @@
{
"name": "@antfu/eslint-config",
"version": "0.38.1",
"version": "0.38.2",
"description": "Anthony's ESLint config",
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
"license": "MIT",

View File

@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-antfu",
"version": "0.38.1",
"version": "0.38.2",
"license": "MIT",
"homepage": "https://github.com/antfu/eslint-config",
"main": "./dist/index.cjs",

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