From d2150eec3b318446d8ff5d669bffddff2a5cdb82 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 30 Mar 2023 11:02:49 +0200 Subject: [PATCH] fix(top-level-function): narrow warning range --- packages/eslint-plugin-antfu/src/rules/top-level-function.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin-antfu/src/rules/top-level-function.ts b/packages/eslint-plugin-antfu/src/rules/top-level-function.ts index 601c1fc722..b0ce043038 100644 --- a/packages/eslint-plugin-antfu/src/rules/top-level-function.ts +++ b/packages/eslint-plugin-antfu/src/rules/top-level-function.ts @@ -48,8 +48,8 @@ export default createEslintRule({ context.report({ node, loc: { - start: node.loc.start, - end: node.loc.end, + start: id.loc.start, + end: body.loc.start, }, messageId: 'topLevelFunctionDeclaration', fix(fixer) {