@stackonward/eslint-config
v1.0.2
Published
Shared ESLint configuration
Readme
@stackonward/eslint-config
Shared ESLint flat configs for standalone TypeScript projects and Nuxt projects. The package combines ESLint's recommended rules, typescript-eslint, and Prettier compatibility with StackOnward's baseline correctness policy.
Install
pnpm add --save-dev @stackonward/eslint-config eslint typescriptStandalone TypeScript
Create eslint.config.js:
import stackOnward from "@stackonward/eslint-config";
export default stackOnward;Nuxt
Nuxt owns its generated base config. Compose the StackOnward policy through the
generated withNuxt helper:
import stackOnwardNuxt from "@stackonward/eslint-config/nuxt";
import withNuxt from "./.nuxt/eslint.config.mjs";
export default withNuxt(...stackOnwardNuxt);Run nuxt prepare before ESLint when .nuxt/eslint.config.mjs has not been
generated yet.
Entry points
| Entry point | Purpose |
| --------------------------------- | -------------------------------------------------------------------- |
| @stackonward/eslint-config | Complete standalone JavaScript and TypeScript flat config |
| @stackonward/eslint-config/nuxt | Policy-only flat config items composed after Nuxt's generated config |
Enforced baseline
- Type-only imports use TypeScript's type import syntax.
- Explicit
anyand unused values are errors; underscore-prefixed arguments may be unused. varis forbidden,prefer-constis enabled, and equality must be strict.- Console output is limited to warnings and errors.
- Generated, dependency, coverage, and build output directories are ignored by the standalone config.
- Prettier-conflicting stylistic rules are disabled.
- Nuxt Vue files require multiline top-level blocks and a blank line between blocks. These auto-fixable rules preserve Prettier output.
Run ESLint fixes before Prettier when formatting Vue files. This expands single-line
template, script and style blocks before Prettier applies indentation.
Consumer projects can append narrower rules after this config. Keep the Nuxt export after Nuxt's generated entries so the intended policy and Prettier compatibility order is preserved.
Compatibility
- Node.js 20.19 or newer
- ESLint 10
- TypeScript 5.7 through 6.0
- ESM flat config
License
MIT
