From 87d26fb63a9b9577c7dcdb87ec601585a092f813 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Wed, 29 Mar 2023 15:46:16 +0200 Subject: [PATCH] feat: enforce to use function declaration on top-level --- README.md | 2 + fixtures/vitesse/src/components/Footer.vue | 2 +- fixtures/vitesse/src/pages/index.vue | 2 +- packages/eslint-config-basic/index.js | 1 + packages/eslint-plugin-antfu/src/index.ts | 2 + .../src/rules/top-level-function.test.ts | 51 ++++++++++++ .../src/rules/top-level-function.ts | 81 +++++++++++++++++++ 7 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 packages/eslint-plugin-antfu/src/rules/top-level-function.test.ts create mode 100644 packages/eslint-plugin-antfu/src/rules/top-level-function.ts diff --git a/README.md b/README.md index 06dbb07..fe9b255 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,8 @@ This config does NOT lint CSS. I personally use [UnoCSS](https://github.com/unoc Sure, you can override the rules in your `.eslintrc` file. + + ```jsonc { "extends": "@antfu", diff --git a/fixtures/vitesse/src/components/Footer.vue b/fixtures/vitesse/src/components/Footer.vue index d1c827c..ae1893b 100644 --- a/fixtures/vitesse/src/components/Footer.vue +++ b/fixtures/vitesse/src/components/Footer.vue @@ -1,7 +1,7 @@