@swarmmachina/standards
| Install | |
|---|---|
npm install @swarmmachina/standards |
|
| Latest Version: | 3.1.0 |
| License: | MPL-2.0 |
| Last Updated: | Jul 30, 2026 |
| Links: | GitHub · npm |
@swarmmachina/standards
Shared ESLint, Prettier, TypeScript and Git tooling for SwarmMachina packages.
Quick start
pnpm add --save-dev @swarmmachina/standards
{
"scripts": {
"check": "swm-standards check",
"fix": "swm-standards fix"
},
"swmStandards": {
"preset": "js"
}
}
Presets: js, typescript, vue, vue-typescript. Override the project
setting for one command with --preset and optionally pass paths:
swm-standards check --preset vue src test
check runs Prettier then ESLint; fix runs ESLint fixes then Prettier writes.
The CLI never guesses a preset and does not run the TypeScript compiler.
Compatibility
| Contour | Consumer installs | Notes |
|---|---|---|
| JavaScript | @swarmmachina/standards |
No TypeScript toolchain |
| Vue/JavaScript | @swarmmachina/standards |
vue-eslint-parser is bundled |
| TypeScript compile | standards + typescript@7.0.2 |
Extends the shared tsconfig |
| TypeScript lint | standards + TS7 native alias + TS6 API alias + typescript-eslint@8.65.0 |
See below |
| Vue/TypeScript | Same lint sidecar | TS7 embedded-language type checking varies |
Supported runtime and pinned tools:
- Node.js
^22.13.0 || 24.x - pnpm
11.15.1 - TypeScript compiler
7.0.2 - ESLint
10.7.0 - Prettier
3.9.6
TypeScript 7
Compiler-only projects can install TypeScript normally:
pnpm add --save-dev @swarmmachina/standards typescript@7.0.2
{
"extends": "@swarmmachina/standards/tsconfig",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": ["src"]
}
The config enables strict checking, NodeNext, ES2024, declarations and source
maps. Projects own rootDir; Node globals require "types": ["node"].
TypeScript 7.0 has no stable programmatic API, while
typescript-eslint@8.65.0 supports TypeScript >=4.8.4 <6.1.0. Linting
therefore uses the official side-by-side layout:
pnpm add --save-dev \
@swarmmachina/standards \
@typescript/native@npm:typescript@7.0.2 \
typescript@npm:@typescript/typescript6@6.0.2 \
typescript-eslint@8.65.0
Here tsc is TS7, tsc6 is the transition compiler, and
typescript-eslint receives the supported TS6 API. Standards does not claim
native TS7 parser support or suppress unsupported-version warnings.
For Vue <script lang="ts">, the vue-typescript preset composes
vue-eslint-parser with this sidecar. Template and TS syntax linting works;
Volar and other embedded-language type tooling may still require TypeScript 6.
Public API
| Export | Contract |
|---|---|
./eslint-js |
JavaScript |
./eslint-typescript |
JavaScript + TypeScript |
./eslint-vue |
JavaScript + Vue |
./eslint-vue-typescript |
JavaScript + TypeScript + Vue |
./prettier |
Shared Prettier config |
./tsconfig |
Strict TS7 compiler base |
./setup-hooks.mjs |
Git hook installer |
swm-standards |
check/fix CLI |
Direct ESLint composition remains supported:
import config from '@swarmmachina/standards/eslint-js'
export default config
Prettier can also be referenced without the CLI:
{
"prettier": "@swarmmachina/standards/prettier"
}
Legacy 1.x paths (./eslint.config.mjs, ./eslint-ts,
./tsconfig.base.json and their code-style forms) remain available. New
projects should use the explicit names above.
Migration from 2.x
Version 3.0.0 changes the license for first-party code from Apache-2.0 to MPL-2.0. Runtime behavior, package exports and tooling compatibility are unchanged. Existing 2.x releases remain available under Apache-2.0; review the MPL-2.0 terms before upgrading.
Migration from 1.2.0
- Move to Node.js 22.13+ or 24 and pnpm 11.15.1.
- Prefer
swm-standards check|fixand declareswmStandards.preset. - For direct composition, replace generic paths with
eslint-js,eslint-typescript,eslint-vueoreslint-vue-typescript. - For TS7 linting, install the TS7/TS6 side-by-side dependencies above.
- Set project-owned
rootDirand Nodetypeswhere required. - Replace
package-lock.jsonwithpnpm-lock.yamland rerun the full gate.
Consumers still pinned to 1.2.0 may temporarily keep autoInstallPeers: true
because that version does not declare vue-eslint-parser. Version 2 bundles
it; after upgrading, set autoInstallPeers: false.
Version 2 is major because Node.js 20 is removed from the runtime contract and the canonical lint contours are now explicit. Compatibility aliases remain.
Git hooks
node node_modules/@swarmmachina/standards/git/setup-hooks.mjs
The installer follows Conventional Commits and never overwrites existing hooks.
Verification and release
pnpm install --frozen-lockfile
pnpm run verify
pnpm pack --dry-run
Fixtures install the tarball in clean JS, TS7, TS-lint and Vue projects on Node 22 and 24, with automatic peer installation disabled.
Publishing is CI-only. After separate approval, a v* tag starts the release
workflow, repeats the pnpm gate and runs npm publish --provenance. Local
publish is forbidden.
License
First-party source code is licensed under the Mozilla Public License 2.0. See LICENSE.
Copyright Contributors to SwarmMachina.
See LICENSING.md for the organization-wide repository policy.
Related Packages
ESLint sharable config: prettier & standard for vue
Version History
| Version | Released | License |
|---|---|---|
| 3.1.0 | MPL-2.0 | |
| 3.0.0 | MPL-2.0 | |
| 2.0.1 | Apache-2.0 | |
| 2.0.0 | Apache-2.0 | |
| 1.2.0 | Apache-2.0 | |
| 1.1.3 | Apache-2.0 | |
| 1.1.2 | Apache-2.0 | |
| 1.1.1 | Apache-2.0 | |
| 1.1.0 | Apache-2.0 | |
| 1.0.4 | Apache-2.0 | |
| 1.0.3 | Apache-2.0 | |
| 1.0.1 | Apache-2.0 |