Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
3963633712 | ||
|
e9193343e8 |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@antfu/eslint-config-monorepo",
|
"name": "@antfu/eslint-config-monorepo",
|
||||||
"version": "0.38.1",
|
"version": "0.38.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@8.0.0",
|
"packageManager": "pnpm@8.0.0",
|
||||||
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@antfu/eslint-config-basic",
|
"name": "@antfu/eslint-config-basic",
|
||||||
"version": "0.38.1",
|
"version": "0.38.2",
|
||||||
"description": "",
|
"description": "",
|
||||||
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@antfu/eslint-config-react",
|
"name": "@antfu/eslint-config-react",
|
||||||
"version": "0.38.1",
|
"version": "0.38.2",
|
||||||
"description": "",
|
"description": "",
|
||||||
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@antfu/eslint-config-ts",
|
"name": "@antfu/eslint-config-ts",
|
||||||
"version": "0.38.1",
|
"version": "0.38.2",
|
||||||
"description": "",
|
"description": "",
|
||||||
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@antfu/eslint-config-vue",
|
"name": "@antfu/eslint-config-vue",
|
||||||
"version": "0.38.1",
|
"version": "0.38.2",
|
||||||
"description": "",
|
"description": "",
|
||||||
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@antfu/eslint-config",
|
"name": "@antfu/eslint-config",
|
||||||
"version": "0.38.1",
|
"version": "0.38.2",
|
||||||
"description": "Anthony's ESLint config",
|
"description": "Anthony's ESLint config",
|
||||||
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "eslint-plugin-antfu",
|
"name": "eslint-plugin-antfu",
|
||||||
"version": "0.38.1",
|
"version": "0.38.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"homepage": "https://github.com/antfu/eslint-config",
|
"homepage": "https://github.com/antfu/eslint-config",
|
||||||
"main": "./dist/index.cjs",
|
"main": "./dist/index.cjs",
|
||||||
|
@@ -26,7 +26,7 @@ const invalids = [
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
'const foo = <K, T extends Boolean>(as: string, bar: number): Omit<T, K> => as + bar',
|
'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 const foo = () => {}',
|
||||||
@@ -34,11 +34,11 @@ const invalids = [
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
'export const foo = () => ({})',
|
'export const foo = () => ({})',
|
||||||
'export function foo () { return {} }',
|
'export function foo () {\n return {}\n}',
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'export const foo = async () => ({})',
|
'export const foo = async () => ({})',
|
||||||
'export async function foo () { return {} }',
|
'export async function foo () {\n return {}\n}',
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@@ -60,7 +60,7 @@ export default createEslintRule<Options, MessageIds>({
|
|||||||
: ''
|
: ''
|
||||||
const textBody = body.type === 'BlockStatement'
|
const textBody = body.type === 'BlockStatement'
|
||||||
? code.slice(body.range[0], body.range[1])
|
? 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
|
const textGeneric = arrowFn.typeParameters
|
||||||
? code.slice(arrowFn.typeParameters.range[0], arrowFn.typeParameters.range[1])
|
? code.slice(arrowFn.typeParameters.range[0], arrowFn.typeParameters.range[1])
|
||||||
: ''
|
: ''
|
||||||
|
Reference in New Issue
Block a user