@nustackjs/lint-plugin-vueuse
v0.4.0
Published
ESLint and Oxlint rules for VueUse. Used by @nustackjs/lint, usable standalone.
Maintainers
Readme
@nustackjs/lint-plugin-vueuse
ESLint and Oxlint rules for VueUse — nudging you toward the composables and away from the raw browser APIs they wrap.
Every rule is grounded in VueUse's official docs, conventions, and recommendations, so they're enforced in your project, not just documented.
Used by @nustackjs/lint, but works standalone in any flat ESLint config.
Install
pnpm add -D @nustackjs/lint-plugin-vueuseUsage
The plugin registers under the scoped name @nustack/vueuse, so every rule id reads
@nustack/vueuse/<rule>.
// eslint.config.js
import vueuse from '@nustackjs/lint-plugin-vueuse'
export default [
// turn on the curated set...
vueuse.configs.recommended,
// ...or wire rules yourself
{
plugins: { '@nustack/vueuse': vueuse },
rules: { '@nustack/vueuse/no-namespace-import': 'error' },
},
]The same applies for OXLint, but some rules may not work due to limited Vue support.
Rules
| Rule | Description |
|---|---|
| @nustack/vueuse/no-namespace-import | Use named imports from @vueuse/core instead of namespace imports. |
| @nustack/vueuse/no-nuxt-auto-import-collision | Alias VueUse imports whose names collide with Nuxt auto-imports. |
| @nustack/vueuse/prefer-use-observers | Prefer VueUse observer composables over raw observer constructors. |
| @nustack/vueuse/prefer-use-storage | Prefer VueUse storage composables over direct localStorage/sessionStorage. |
| @nustack/vueuse/prefer-use-timers | Prefer VueUse timer composables over raw setTimeout/setInterval. |
| @nustack/vueuse/prefer-useclipboard | Prefer useClipboard() over navigator.clipboard. |
| @nustack/vueuse/prefer-useevent-listener | Prefer useEventListener() over add/removeEventListener. |
| @nustack/vueuse/prefer-usewindow-size | Prefer useWindowSize() over direct window.innerWidth/innerHeight. |
License
MIT © Zerya
