Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply linting rules to composables as well #2715

Open
Bart-Westenenk opened this issue Mar 15, 2025 · 0 comments
Open

Apply linting rules to composables as well #2715

Bart-Westenenk opened this issue Mar 15, 2025 · 0 comments

Comments

@Bart-Westenenk
Copy link

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:

  1. 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.
  2. Make the plugin also trigger on .ts files containing Vue composables.

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant