@nustackjs/lint-plugin-nuxt
v0.4.0
Published
ESLint and Oxlint rules for Nuxt runtime conventions. Used by @nustackjs/lint, usable standalone.
Maintainers
Readme
@nustackjs/lint-plugin-nuxt
ESLint and Oxlint rules for Nuxt conventions -
runtimeConfig safety, auto-imports, keeping process.env out of app
code, and nuxt.config modules correctness (registration order, deprecated modules).
Every rule is grounded in Nuxt'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-nuxtUsage
The plugin registers under the scoped name @nustack/nuxt, so every rule id reads
@nustack/nuxt/<rule>.
// eslint.config.js
import nuxt from '@nustackjs/lint-plugin-nuxt'
export default [
// turn on the curated set...
nuxt.configs.recommended,
// ...or wire rules yourself
{
plugins: { '@nustack/nuxt': nuxt },
rules: { '@nustack/nuxt/no-process-env': 'warn' },
},
]The same applies for OXLint, but some rules may not work due to limited Vue support.
Rules
| Rule | Description |
|---|---|
| @nustack/nuxt/modules-order | Enforce a correct registration order for interdependent Nuxt modules. |
| @nustack/nuxt/no-deprecated-modules | Disallow deprecated Nuxt modules in favor of their maintained successors. |
| @nustack/nuxt/no-explicit-auto-import | Disallow explicit imports of identifiers/components Nuxt already auto-imports. |
| @nustack/nuxt/no-process-env | Disallow process.env in app code; use runtimeConfig / useRuntimeConfig(). |
| @nustack/nuxt/no-secret-in-public-runtimeconfig | Disallow secret-looking keys under runtimeConfig.public. |
License
MIT © Zerya and contributors
