Workspace rules
Checks on the workspace layout: patterns that match nothing and directories without a manifest.
| Rule | Default severity | Fixable |
|---|---|---|
foreign-package-manager-command |
warning | none |
invalid-workspace-file |
error | none |
lerna-packages-mismatch |
warning | none |
missing-package-manifest |
warning | unsafe |
nested-workspace-root |
warning | none |
stale-lerna-config |
warning | none |
stale-patched-dependencies |
warning | none |
stray-lockfile |
warning | unsafe |
toolchain-pin-drift |
warning | none |
unmatched-workspace-patterns |
warning | unsafe |
Fixable is safe (applied by --fix), unsafe (applied only by --fix-unsafe), sometimes (fixable for some findings) or none. See the CLI reference.
foreign-package-manager-command
Section titled “foreign-package-manager-command”Dockerfiles, CI workflows and shell scripts must not run a package manager other than the workspace’s.
- Default severity: warning
- Fixable: none
[rules]foreign-package-manager-command = "warn"invalid-workspace-file
Section titled “invalid-workspace-file”A member package.json, a workspace pattern or .yarnrc.yml cannot be read, so part of the workspace is not linted.
- Default severity: error
- Fixable: none
[rules]invalid-workspace-file = "error"lerna-packages-mismatch
Section titled “lerna-packages-mismatch”The packages of lerna.json, which Lerna reads before the package manager’s workspaces, select other packages than the workspace declaration.
- Default severity: warning
- Fixable: none
[rules]lerna-packages-mismatch = "warn"missing-package-manifest
Section titled “missing-package-manifest”A directory matched by the workspace patterns has no package.json, or in a Bun workspace one without a name, which Bun does not install.
- Default severity: warning
- Fixable: unsafe
- sherif name:
packages-without-package-json
[rules]missing-package-manifest = "warn"nested-workspace-root
Section titled “nested-workspace-root”A workspace member holds a pnpm-workspace.yaml of its own, so installs in that directory leave the workspace, or in a Bun workspace a package.json that declares workspaces, which Bun never installs; or a member is a Bazel convenience link (bazel-<name>) a workspace pattern follows.
- Default severity: warning
- Fixable: none
[rules]nested-workspace-root = "warn"stale-lerna-config
Section titled “stale-lerna-config”lerna.json sets useWorkspaces or lacks version, which Lerna 7 and later reject, or a script runs lerna bootstrap, lerna add or lerna link, which Lerna 9 removed.
- Default severity: warning
- Fixable: none
[rules]stale-lerna-config = "warn"stale-patched-dependencies
Section titled “stale-patched-dependencies”A patchedDependencies entry no longer applies, names a missing file or lies outside the allowed paths, or a patch file is left over.
- Default severity: warning
- Fixable: none
[rules]stale-patched-dependencies = "warn"stray-lockfile
Section titled “stray-lockfile”A lockfile other than the root lockfile of the package manager: one in a workspace member, another manager’s at the root, or one its manager ignores next to the one it reads (Bun’s bun.lockb beside bun.lock, npm’s package-lock.json beside npm-shrinkwrap.json).
- Default severity: warning
- Fixable: unsafe
[rules]stray-lockfile = "warn"toolchain-pin-drift
Section titled “toolchain-pin-drift”Node and package-manager versions pinned in version files, Dockerfiles, CI workflows and Bazel module files must match the root’s.
- Default severity: warning
- Fixable: none
[rules]toolchain-pin-drift = "warn"unmatched-workspace-patterns
Section titled “unmatched-workspace-patterns”A workspace pattern does not match any directory.
- Default severity: warning
- Fixable: unsafe
- sherif name:
non-existant-packages
[rules]unmatched-workspace-patterns = "warn"