@scayle/eslint-plugin-vue-composable
v0.2.1
Published
Rules to avoid unpleasant composable problems
Downloads
6,250
Readme
@scayle/eslint-plugin-vue-composable
Rules to avoid unpleasant composable problems
Installation
You'll need to install ESLint along with this package:
# Using pnpm
pnpm add --dev eslint @scayle/eslint-plugin-vue-composable
# Using yarn
yarn add --dev eslint @scayle/eslint-plugin-vue-composable
# Using npm
npm install --save-dev eslint @scayle/eslint-plugin-vue-composable
Usage
Add @scayle/eslint-plugin-vue-composable
to the plugins section of your .eslintrc
configuration file.
{
"plugins": [
"@scayle/vue-composable"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"@scayle/vue-composable/no-composable-after-await": "warn",
"@scayle/vue-composable/no-lifecycle-after-await": "error",
"@scayle/vue-composable/no-watch-after-await": "error",
"@scayle/vue-composable/no-computed-after-await": "error"
}
}
Rules
| Name | Description |
| :------------------------------------------------------------------- | :-------------------------------------------------------------------------- |
| no-composable-after-await | disallow asynchronously called composable functions in composables |
| no-computed-after-await | disallow asynchronously registered computed
in composables |
| no-lifecycle-after-await | disallow asynchronously registered lifecycle hooks in composables |
| no-watch-after-await | disallow asynchronously registered watch
and watchEffect
in composables |
License
Licensed under the MIT License