@prata.ma/anvil-eslint
v0.3.7
Published
Anvil-owned ESLint plugin for governed markdown and manifest enforcement.
Readme
@prata.ma/anvil-eslint
Anvil-owned ESLint plugin for governed markdown and manifest enforcement.
Overview
@prata.ma/anvil-eslint owns the custom ESLint plugin rules and the small shared config surface that still belongs at package level. It covers reusable markdown structure checks, manifest validation, and the split package CHANGELOG.md rule bundle for H1, H2, H3, and change-list validation.
Within the workspace and for external consumers, this package is the home for Anvil-specific lint behavior that does not belong in the general shared config package. Consumers should use @prata.ma/anvil-eslint when they need the documented plugin and config surface instead of duplicating markdown-rule logic in package-local lint setup.
Installation
Install the package from npm when using the documented plugin surface outside this monorepo.
npm
{
"devDependencies": {
"@prata.ma/anvil-eslint": "^0.0.0"
}
}Usage
The package is used as an ESLint plugin surface. The main consumption paths are the plugin itself and the shared config groups that still apply across package and repo surfaces.
Library
import anvilEslint from '@prata.ma/anvil-eslint'
export default [
{
plugins: {
anvil: anvilEslint,
},
rules: {
'anvil/md-required-frontmatter': ['error', { keys: ['title'] }],
'anvil/md-heading-starts-at': ['error', { depth: 2 }],
},
},
]Patterns
Typical usage patterns include:
- applying markdown structure rules to governed docs and package changelogs
- using shared config groups for
anvil.yamlandCHANGELOG.md - layering block-owned lint surfaces on top of the shared plugin rules when artifact doctrine belongs to a catalog block
API
@prata.ma/anvil-eslint exposes a plugin default export with rules, metadata, and shared config groups.
Exports
@prata.ma/anvil-eslint- default ESLint plugin export- plugin
metawith package name and version anvil/md-heading-starts-atanvil/md-max-charsanvil/md-max-linesanvil/md-max-tokensanvil/md-no-fenced-code-blocksanvil/md-no-heading-beyondanvil/md-no-tablesanvil/md-changelog-h1anvil/md-changelog-h2anvil/md-changelog-h3anvil/md-changelog-changesanvil/md-required-frontmatteranvil/md-required-headings- shared config groups from
createConfigs(plugin), includingmanifestandchangelogs
Configuration
changelogsapplies the changelog H1, H2, H3, and changes rules to workspace package and versioned block-packageCHANGELOG.mdfiles.anvil/md-changelog-h1resolves the expected H1 from the siblingpackage.jsonname for eachCHANGELOG.md.anvil/md-changelog-changesvalidates each H3 body as a whole bullet-list block and flattens ambiguous malformed bullets into sibling top-level items by default.
Development
Use the package-local scripts while working in @packages/anvil-eslint, and keep new Anvil-specific lint behavior inside this package instead of pushing it into the shared @repo/lint config package.
This package now participates in the repo's Changesets, npm publish, and GitHub Release automation as a package-scoped public surface. The package-local release:check script remains the focused validation contract for this package.
Commands
pnpm --filter @prata.ma/anvil-eslint release:check
pnpm --filter @prata.ma/anvil-eslint build
pnpm --filter @prata.ma/anvil-eslint lint
pnpm --filter @prata.ma/anvil-eslint test
pnpm --filter @prata.ma/anvil-eslint test:typeTesting
The current Vitest coverage focuses on markdown-rule helper behavior, split package changelog enforcement, and shared config wiring.
Conventions
- Keep plugin rules deterministic and based on observable markdown structure rather than repo-specific heuristics.
- Keep changelog autofixes deterministic and structure-aware: H1s resolve from sibling
package.jsonfiles and H3 change blocks normalize malformed list indentation without rewriting valid release prose. - Keep custom Anvil-owned rules here; keep general ESLint baseline concerns in
@repo/lint.
Status
This package is active and currently focused on Anvil-specific markdown and manifest linting.
Maturity
@prata.ma/anvil-eslint is active and publish-prepared as a reusable package.
Scope
The package currently supports custom markdown rules plus shared config sets for governed repo surfaces including workspace package changelogs. It does not replace the shared flat-config baseline owned by @repo/lint.
Notes
@prata.ma/anvil-eslintnow ships a packageCHANGELOG.mdand participates in the repo's multi-package release workflow.- Changes to rule behavior can affect governed docs across
@catalog/,@product/,@system/, and@state/.
