#!/bin/sh # script/lint: run the linters. eslint and prettier are never run against # the working tree from here: linting runs via docker only, one way, # everywhere — script/lint builds Dockerfile.lint, which COPYs the repo into # the pinned node image and runs the linters as build steps. That works even # when the docker daemon is remote and bind mounts are impossible. # # LINT_EPOCH is passed on every invocation because no lint cache is wanted: # on an unchanged tree Docker would otherwise serve the linter layers, having # linted nothing, and still exit 0. Dockerfile.lint refuses to build without # the argument, so no path to a lint result can quietly come from cache. # # Nothing that runs inside a container may call this script; see the header # of Dockerfile. set -eu ROOT="$(cd "$(dirname "$0")/.." && pwd -P)" main() { cd "$ROOT" docker build --build-arg LINT_EPOCH="$(date +%s)" -f Dockerfile.lint . } main "$@"