33 lines
1.6 KiB
Markdown
33 lines
1.6 KiB
Markdown
---
|
|
description: package.json keys follow Oxfmt's standard order (vp check --fix); standard fields only; no peerDependencies or packageManager
|
|
---
|
|
|
|
## Key order (2026-10-16)
|
|
|
|
Oxfmt's standard `package.json` sorting is accepted: there is no
|
|
`fmt: { sortPackageJson: false }`, and `vp check --fix` sets the order. This
|
|
replaces the earlier hand-written order (metadata, `scripts`, `exports`,
|
|
`imports`, `devDependencies`, `dependencies`).
|
|
|
|
The `imports` key order can carry meaning: import-check's
|
|
`enforce-layer-order` reads it as the layer order. Never reorder it casually.
|
|
|
|
## Fields
|
|
|
|
- **Standard fields only.** `engines` has only `node` (never `engines.bun`).
|
|
A tool-owned key (`eslint-doc-generator`) is allowed only because the tool
|
|
reads nothing else and no other config file is allowed.
|
|
- **No `packageManager`.** npm is detected from `package-lock.json`.
|
|
- **No `peerDependencies`, ever** (user preference, 2026-10-14). If something
|
|
is needed at runtime, it goes in `dependencies`.
|
|
- **`dependencies`** = what runs or is type-referenced at runtime by consumers
|
|
(the lit plugin ships `parse5`, `oxc-parser`, `oxc-resolver`, and
|
|
`@eslint/core` for its public types; they stay external, never bundled).
|
|
- **`devDependencies`** = everything else: `vite-plus`, `eslint`,
|
|
`@typescript-eslint/parser`, `eslint-doc-generator`, `esbuild`,
|
|
`typescript-6`, `@types/node`. ESLint is a devDependency only; plugins need
|
|
nothing from it at runtime.
|
|
|
|
Refresh the lockfile with `npm install` (or `npm install
|
|
--package-lock-only` for a version bump) and commit it with the change.
|