eslint-plugin-vue
eslint-plugin-vue copied to clipboard
Apply linting rules to composables as well
Tell us about your environment
- ESLint version: v9.22.0
- eslint-plugin-vue version: 10.0.0
- Vue version: 3.5.13
- Node version: v22.14.0
The problem you want to solve.
Many composables, from simple to advanced, use some kind of Vue functionality like computed properties, refs, hooks, watchers etc. (I propably forgot something). These composables are not linted, so for example when a computed property has a side effect, the vue/no-side-effects-in-computed-properties is not triggered while it very much can be triggered.
Your take on the correct solution to problem. I think there are multiple solutions:
- Detect composables by the use of Vue functionality like triggering watchers, using hooks, returning computed properties etc. This also allows for more composable specific rules and has more potential, but more work.
- Make the plugin also trigger on .ts files containing Vue composables.
Additional context