A Dagger toolchain — written in the .dang module
language — that lints your project with ESLint, using
your project's own ESLint configuration and version.
| Function | Description |
|---|---|
lint |
Lint the source (a @check). |
fix |
Fix linting issues; returns the changes as a Changeset. |
Install the module in your workspace:
dagger install github.com/dagger/eslintRun the lint check:
dagger check # run every check in the workspace
dagger check eslint:lint # just the ESLint checkFix linting issues — returns a changeset; approve it to apply the fixes to
your workspace (or pass -y to auto-apply):
dagger api call eslint fixFunctions run from your current working directory within the workspace. The
whole workspace is mounted — so shared configuration like a root
.eslintrc.* or eslint.config.* still resolves — but ESLint itself runs
from the directory you invoke dagger from. Run from the workspace root to
cover everything, or from a subdirectory to scope lint and fix to that
subtree.
If the workspace root holds no package.json, the dependency install is
skipped and npx fetches ESLint on demand — a standalone eslint config
works without a Node project.
The toolchain can be customized in your dagger.json to meet your needs:
{
"name": "my-module",
"engineVersion": "...",
"toolchains": [
{
"name": "eslint",
"source": "github.com/dagger/eslint@main",
"pin": "...",
"customizations": [
{
"argument": "baseImageAddress",
"default": "node:22" # default: node:25-alpine; use any container image
},
{
"argument": "packageManager",
"default": "yarn" # default: npm; alternatively use yarn, pnpm, or bun
}
]
}
]
}