This documentation is available as Markdown. For the complete index, see llms.txt. Skip to content

Linter rules

For the complete documentation index, see llms.txt

The linter keeps scenarios robust — stable selectors, no silent waits. Override any rule under linter.rules in your config ("off" | "warn" | "error"). Silence a single justified warning with a trailing // lint-ok: <reason> on its line — the reason is required, and error-severity diagnostics are never suppressible.

RuleDefaultPurpose
lint:deep-csswarnReject deep / brittle CSS selectors. Prefer role/label/testid.
lint:xpathwarnReject XPath selectors.
lint:obfuscated-classwarnReject hashed class names (Tailwind JIT, CSS Modules).
lint:pause-explicitwarnDiscourage pause(ms). Silence a justified one with // lint-ok: <reason>.
lint:disambig-by-indexoffFlag index-only refinement (.nth) as fragile (info).
lint:evaluate-discouragedwarnDiscourage bare evaluate() — prefer typed helpers.
lint:scenario-in-rooterrorScenarios must live in a feature subfolder, not the e2e root.
lint:mustache-in-dslerrorNo {{VAR}} string literals — reference bare identifiers.
lint:goto-concatwarngoto(BASE_URL + ‘/x’) → write goto(‘/x’); the base comes from the environment.
lint:regex-invaliderrorRegex literal that does not compile.
lint:echo-assertwarnwaitForText/assertText overlaps a value the scenario itself filled — the assert can match your own message (chat echo trap).
lint:api-call-file-bodywarnA JSON apiCall body with a file key sends the value as a string — no file is attached. Pass upload(...) as the body for a real multipart upload.
lint:lint-ok-missing-reasonwarnBare // lint-ok without a reason — suppresses nothing.
lint:flow-returns-valuewarnA flow_* helper returns a value. Legitimate when the flow acts and yields its result (email = flow_signup()); if it only reads state, rename it to a plain snake_case helper — flow_* is an executable entry the agent may replay.
lint:legacy-layoutwarnunotest.config.* still sits at the project root (pre-0.28 layout), where nothing reads it. lint grades the suite on default settings and says so once; e2e / collection / bundle push refuse until the config is moved.
lint:external-variable-undeclarederrorA bare UPPER_SNAKE identifier that no layer file declares (unotest/.env, .secrets, the active --env overlay). It would fail at that statement at run time; the message lists the files searched. The shell is not a declaration — NAME= with no value in unotest/.env declares a name the shell provides.
lint:one-test-per-filewarnA second test_* in one scenario file. The file is the unit a collection runs and the viewer shows (Steps projects the run onto the first test_*); iterate cases inside one test with step("…", {tag: id}, …) or move journeys to _helpers/. Warning in 0.31, error in a later release.
validator:unknown-functionerrorUnknown DSL function (typo, unsupported call).
validator:arityerrorWrong number of arguments for a DSL function.
validator:arg-kinderrorArgument of the wrong kind (locator where a string is required, and so on).
validator:step-coverageerrorA test_* entry function with executable statements outside step("…", () => { … }).
validator:step-shapeerrorMalformed step(...) — the label must be a string literal and the body an arrow function.
validator:meta-shapeerrorMalformed scenario metadata block.
validator:function-shapeerrorMalformed function declaration in a scenario or helper.
validator:for-shapeerrorUnsupported for form — iterate with the supported shape.
validator:if-shapeerrorUnsupported if form.
validator:var-shapeerrorUnsupported variable declaration.
validator:unsupported-statementerrorStatement the DSL engine does not execute (try, while, class, …).
validator:unsupported-expressionerrorExpression the DSL engine does not evaluate.
validator:string-concaterrorLiteral-free string addition (a + b between string variables) — use textJoin([...]).
validator:semantic-losserrorA construct that would silently change meaning when executed.
validator:list-argerrorMalformed list argument.
validator:wrapped-formaterrorMalformed wrapped/format call.