antfu-collective / vitesse

🏕 Opinionated Vite + Vue Starter Template
https://vitesse.netlify.app/
MIT License
8.79k stars 932 forks source link

Composable syntax #500

Closed sjkey closed 1 year ago

sjkey commented 1 year ago

Describe the bug

The @antfu/eslint-config-vue extends @antfu/eslint-config-basic in which there is a rule 'antfu/top-level-function': 'error',. Because of that, ESLint throws an error when you try to write composable using ES6 syntax.

Screenshot 2023-05-31 at 07 31 30

Reproduction

Create composable following ES6 syntax

System Info

System:
    OS: macOS 13.2.1
    CPU: (8) arm64 Apple M1
    Memory: 100.47 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 19.9.0 - ~/.nvm/versions/node/v19.9.0/bin/node
    Yarn: 1.22.17 - /usr/local/bin/yarn
    npm: 9.6.3 - ~/.nvm/versions/node/v19.9.0/bin/npm
  Browsers:
    Chrome: 113.0.5672.126
    Firefox: 113.0.2
    Safari: 16.3

Used Package Manager

pnpm

Validations

antfu commented 1 year ago

It's not about ES6. And it's just an opinionated rule, you can always disable it.