@nustackjs/lint
v0.5.0
Published
Zero-config, project-aware ESLint (oxlint-ready) for Nuxt — plug it in and catch Nuxt bugs, not just style.
Maintainers
Readme
NuStack Lint
Zero-config linting for Nuxt: one project-aware module that catches real bugs and validates conventions that usually live only in documentation across the ecosystem: Nuxt, Vite, Nuxt UI, VueUse, Tailwind, and more. Part of NuStack.
[!NOTE] The rules also ship as standalone ESLint/Oxlint plugins if you only want one slice. Use the individual packages for focused checks without the full Nuxt module: nuxt, vueuse, vite, and nuxt-ecosystem.
[!IMPORTANT] ESLint is the current engine; Oxlint is the
v1target. Expect breaking rule changes before reaching stablev1. Feel free to track the roadmap in issue #7.
What it does for you
- Deep, ecosystem-aware rules. Detect the Nuxt modules and tools your project uses, then auto-enable rules built from each tool's best practices.
- One module, shared presets. Stop wiring the same plugins and configs in every project; install one module and reuse the same preset across your apps.
- Enforced decisions. Keep practices and architectural decisions in executable rules instead of review comments or even worse
AGENTS.md.
For the longer design rationale, see the RFC 01: NuStack Lint.
Coverage
The preset composes these layers and gates each on what your project actually uses:
- Antfu base: style, TypeScript, imports, and JS hygiene via
@antfu/eslint-config. - Nuxt core: auto-imports,
runtimeConfig, module order, andprocess.envvia@nuxt/eslintand@nustackjs/lint-plugin-nuxt. - VueUse: prefer lifecycle-aware composables via
@nustackjs/lint-plugin-vueuse. - Vite: asset and env safety via
@nustackjs/lint-plugin-vite. - Nuxt ecosystem: conventions for individual Nuxt modules via
@nustackjs/lint-plugin-nuxt-ecosystem. - Tailwind: class order and correctness via better-tailwindcss.
- Vue SFC conventions from
eslint-plugin-vue(e.g.lang="ts"blocks).
Want a rule added, or a plugin integrated? Open an issue - the ruleset is meant to grow with what the community uses.
Environments
A target option pre-fills the preset for the project you're actually in — a normal
Nuxt app, a non-Nuxt Vue SPA, or a Nuxt module/library:
nustack({ target: 'nuxt-app' }) // default for the generated Nuxt-path config
nustack({ target: 'vue-app' }) // non-Nuxt Vue SPA — no `nuxt prepare` needed
nustack({ target: 'nuxt-module' }) // authoring a Nuxt module; `playground/**` lints itselfSee Configuration for what each target pre-fills.
Setup
npx nuxi module add @nustackjs/lintThat's the only Nuxt module you list:
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@nustackjs/lint'],
})Then point eslint.config.ts at the generated config:
// eslint.config.ts
export { default } from './.nuxt/nustack-eslint.mjs'eslint . # quick checks (fast)
NUSTACK_LINT_DEPTH=full eslint . # + type-aware checks (CI), not recommended below v1See Installation, Configuration, and Migration for full setup, options, and overrides.
Config inspector
The preset returns a FlatConfigComposer, so the exact resolved config is inspectable:
npx @eslint/config-inspector --config eslint.config.tsContributing
See DEVELOPMENT.md - the design specification and other important information.
Credits
- Anthony Fu: for
@antfu/eslint-configwhich this project is based on.
License
MIT © Zerya and contributors
