Closed sjkey closed 1 year ago
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.
@antfu/eslint-config-vue
@antfu/eslint-config-basic
'antfu/top-level-function': 'error',
Create composable following ES6 syntax
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
pnpm
It's not about ES6. And it's just an opinionated rule, you can always disable it.
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.Reproduction
Create composable following ES6 syntax
System Info
Used Package Manager
pnpm
Validations