@nustackjs/lint-plugin-nuxt-ecosystem
v0.4.0
Published
ESLint and Oxlint rules for the Nuxt module ecosystem (Nuxt UI). Used by @nustackjs/lint, usable standalone.
Maintainers
Readme
@nustackjs/lint-plugin-nuxt-ecosystem
ESLint and Oxlint rules for the Nuxt module ecosystem.
Currently supports @nuxt/ui, but the list will grow fast.
Every rule is grounded in each module's official docs, conventions, and recommendations, so they're enforced in your project, not just documented.
If you are a developer of a fairly popular module, please reach out; we'd love to add it!
Used by @nustackjs/lint, but works standalone in any flat ESLint config.
Install
pnpm add -D @nustackjs/lint-plugin-nuxt-ecosystemUsage
Rule ids read @nustack/nuxt-ui/<rule>. Use configs.ui for just the Nuxt UI pack, or
configs.recommended for the union of every ecosystem pack in this package.
// eslint.config.js
import nuxtEcosystem from '@nustackjs/lint-plugin-nuxt-ecosystem'
export default [
// just the Nuxt UI pack...
nuxtEcosystem.configs.ui,
// ...or wire rules yourself
{
plugins: { '@nustack/nuxt-ui': nuxtEcosystem },
rules: { '@nustack/nuxt-ui/prefer-u-button': 'warn' },
},
]The same applies for OXLint, but some rules may not work due to limited Vue support.
Rules
Nuxt UI
| Rule | Description |
|---|---|
| @nustack/nuxt-ui/prefer-u-button | Prefer <UButton> over raw <button> when @nuxt/ui is available. |
| @nustack/nuxt-ui/prefer-u-form-controls | Prefer Nuxt UI form controls over raw native form elements; type-aware (e.g. <input type="number"> / <UInput type="number"> → <UInputNumber>). |
| @nustack/nuxt-ui/prefer-u-link | Prefer <ULink> over raw <a> when @nuxt/ui is available. |
| @nustack/nuxt-ui/prefer-u-table | Prefer <UTable> over raw <table> when @nuxt/ui is available. |
| @nustack/nuxt-ui/no-deprecated-components | Disallow Nuxt UI components renamed in v4 (e.g. UButtonGroup → UFieldGroup). |
| @nustack/nuxt-ui/no-deprecated-model-modifiers | Disallow the v-model.nullify modifier renamed to .nullable in Nuxt UI v4. |
License
MIT © Zerya and contributors
