@osmeridian/lint-typecheck-format-test
v1.0.7
Published
Shared lint, format, typecheck defaults, and vitest factory for Omniswift Vue/Nuxt apps
Maintainers
Readme
@osmeridian/lint-typecheck-format-test
Shared lint, format, typecheck defaults, and Vitest factory for Omniswift Vue/Nuxt apps.
Rule changes belong in this repository only. Consuming apps must keep thin re-exports and documented overlays — do not fork rule bodies locally.
Install (npm)
pnpm add -D @osmeridian/lint-typecheck-format-test oxc-nuxtOr pin an exact version:
{
"devDependencies": {
"@osmeridian/lint-typecheck-format-test": "1.0.7",
"oxc-nuxt": "^0.1.5"
}
}oxc-nuxt is a required peer — install it on the Nuxt app and register "oxc-nuxt" in nuxt.config modules. It generates .nuxt/oxlint.mjs (withNuxt) so oxlint knows Nuxt auto-import globals. This package does not bundle or register that module.
Publishing this package (maintainers)
- Enable 2FA on your npm account: npmjs.com/settings/~/tfa (required to publish).
- Create a granular access token with publish rights:
- npmjs.com/settings/~/tokens → Generate New Token → Granular Access Token
- Permissions: Read and write for packages (or restrict to
@osmeridian/lint-typecheck-format-test) - Enable Bypass two-factor authentication (2FA) for automation (needed for CLI publish)
- Organizations: include osmeridian
- Put the token in your user npmrc (do not commit this):
npm config set //registry.npmjs.org/:_authToken=YOUR_TOKEN_HERE- Confirm login works:
npm whoami - From this repo:
pnpm publish:npm - Tag the git release to match (
git tag v1.0.7 && git push origin v1.0.7if needed).
Exports include TypeScript types — consumers do not need local declare module shims.
Scoped packages need --access public the first time (already set in publishConfig and the script).
Consumer setup
ESLint
// eslint.config.js
import base from "@osmeridian/lint-typecheck-format-test/eslint";
import hexagonal from "./eslint.hexagonal.js"; // optional app overlay
export default [...base, ...hexagonal];Oxlint (Nuxt)
- Add
oxc-nuxttonuxt.configmodules(peer — not provided by this package). - Run
nuxt prepareso.nuxt/oxlint.mjsexists. - Wrap shared rules with
withNuxt:
// oxlint.config.ts
import { withNuxt } from "./.nuxt/oxlint.mjs";
import { baseOxlint } from "@osmeridian/lint-typecheck-format-test/oxlint";
export default withNuxt({
...baseOxlint,
overrides: [...(baseOxlint.overrides ?? []), /* app-only overrides */],
});Prettier
// .prettierrc.mjs
import base from "@osmeridian/lint-typecheck-format-test/prettier";
export default {
...base,
tailwindStylesheet: "./app/assets/styles/tailwind.css",
tailwindFunctions: ["cn", "clsx"],
};Tailwind plugin path is resolved inside the package — no consumer createRequire needed.
ltft format always applies the package prettierignore (Nuxt/build defaults), plus the
project's .gitignore and .prettierignore when those files exist. Keep app-specific
excludes in the project .prettierignore only.
Scripts
{
"scripts": {
"lint": "ltft lint",
"lint:fix": "ltft lint:fix",
"format": "ltft format",
"format:fix": "ltft format:fix",
"typecheck": "nuxt typecheck",
"test": "vitest run"
}
}Typecheck defaults
import { nuxtTypescriptDefaults } from "@osmeridian/lint-typecheck-format-test/typescript/nuxt";
export default defineNuxtConfig({
typescript: {
tsConfig: {
...nuxtTypescriptDefaults,
// app paths / excludes
},
},
});Vitest
import { fileURLToPath } from "node:url";
import { createVitestConfig } from "@osmeridian/lint-typecheck-format-test/vitest";
const rootDir = fileURLToPath(new URL(".", import.meta.url));
export default createVitestConfig({
rootDir,
aliases: [
/* app-specific fixture aliases */
],
});Overlay allowlist
Allowed in consumers:
| File | Purpose |
| --- | --- |
| eslint.hexagonal.js (or similar) | Architecture no-restricted-imports |
| oxlint.config.ts app overrides | Path-specific rule exceptions |
| .prettierrc.mjs | tailwindStylesheet / tailwindFunctions |
| nuxt.config.ts | Merge typecheck defaults + app tsConfig |
| vitest.config.ts | Root, includes, aliases, setup files |
Not allowed: copying or editing shared rule tables from this package into the app.
Requesting rule changes
Open a PR against osmeridian/lint-typecheck-format-test, bump a semver tag (v1.x.x), and update consumer dependency pins.
CLI
ltft lint
ltft lint:fix
ltft format # check
ltft format:fix # writePackage exports
| Export | Path |
| --- | --- |
| @osmeridian/lint-typecheck-format-test/eslint | Shared ESLint flat config + custom Vue attr rule + utils -utils filename rule |
| @osmeridian/lint-typecheck-format-test/oxlint | baseOxlint object |
| @osmeridian/lint-typecheck-format-test/prettier | Base Prettier options |
| @osmeridian/lint-typecheck-format-test/vitest | createVitestConfig |
| @osmeridian/lint-typecheck-format-test/typescript/nuxt | nuxtTypescriptDefaults |
Example stubs
See examples/nuxt-consumer/ for copy-paste ESLint, Oxlint, Prettier, Vitest, and package.json script stubs.
Follow-ups
- CI drift check that consumer configs only re-export / allowlisted overlays
- Wire first consumer apps after this package is on npm
- Optional: GitHub Actions
releaseworkflow that publishes on tag push
