batteries/media/lint
Remarks
Battery-scoped rules ship with the battery, not with the core @nhtio/adk/eslint plugin — they only matter to deployments that compose this battery, and they version with the battery's own API. The rules are report-only (no autofix); carve out a deliberate exception with an inline // eslint-disable-next-line adk-media/{rule} -- {reason} comment.
@typescript-eslint/utils and eslint are OPTIONAL peer dependencies of @nhtio/adk — installed only by consumers who lint with this plugin. The battery never imports this module at runtime.
Example
Flat config
ts
import adkMedia from "@nhtio/adk/batteries/media/lint";
export default [
{
plugins: { "adk-media": adkMedia.plugin },
rules: adkMedia.configs.recommended.rules,
},
];Interfaces
| Interface | Description |
|---|---|
| EngineSummary | A statically-derived capability summary for one engines-array element. |
Type Aliases
| Type Alias | Description |
|---|---|
| PeerResolver | The peer-resolution probe: returns true when peer resolves from fromFile. Defaults to Node's resolver anchored at the linted file (so it sees the consumer's node_modules). Exposed as a settable seam so the rule's spec can simulate installed/missing peers without depending on the test runner's own node_modules layout — production never sets it. |
Variables
| Variable | Description |
|---|---|
| BUNDLED_SUMMARIES | Known declarations of the bundled engine factories, for shadow analysis. An ESLint rule cannot execute the factories it lints, so this table mirrors their declarations by hand — and is pinned against the live factories by a drift test (lint_drift.node.spec.ts). Exported for that test only. |
| configs | Named config presets. recommended enables every rule at error and registers the plugin under the adk-media namespace — spread it into a flat config to adopt the full set. |
| default | Default export bundles the plugin and its config presets, mirroring the shape ESLint flat configs expect from a plugin module. |
| ENGINE_PEERS | The optional peer dependencies each bundled engine subpath lazily imports at runtime. Keyed by the engine's subpath suffix (after engines/). An engine with no external peer (soffice, fs_workspace) is absent — there's nothing to install. Kept in lockstep with the engines' actual import(...) calls by engine_peers_drift.node.spec.ts. |
| plugin | The media battery's ESLint plugin object. Register under the adk-media namespace: plugins: { 'adk-media': plugin }. |
| rules | Map of rule id (without the adk-media/ plugin prefix) to its rule object. Registered on the plugin as rules, so configs reference them as adk-media/{id}. |
Functions
| Function | Description |
|---|---|
| setPeerResolverForTesting | Override the peer resolver (spec-only seam). Pass nothing to restore the Node default. |