eslint-plugin-no-mistakes
v0.109.123
Published
ESLint and Oxlint rules that keep code static enough for no-mistakes analyzers and coding agents
Readme
eslint-plugin-no-mistakes
ESLint and Oxlint rules that keep TS/JS, React, Next.js, and Playwright code
static enough for no-mistakes analyzers. They exist so agents cannot hide
callers, fetches, or selectors behind aliases and dynamic values. See
why no-mistakes exists.
npm install --save-dev eslint-plugin-no-mistakesFor async-call-disposition to inspect imported callback implementations when
the linter does not provide a TypeScript program (including Oxlint's
--type-aware mode), also install typescript in your project:
npm install --save-dev typescripttypescript and @typescript-eslint/parser are optional peers, but only
typescript is required for the cross-file proof. When the ESLint parser is
absent, the proof parses supported syntax with ts.createSourceFile; unsupported
syntax stays unproven. This fallback requires TypeScript 5 or
later for Bundler module resolution. With older TypeScript or missing or
incompatible tooling, calls that rely on this cross-file proof are reported as
unproven. Same-file proofs and explicitly configured awaiting-consumer
contracts continue to work. When ESLint provides a typed TypeScript program,
the rule continues to use that program for its typed proof.
Configure the plugin in a flat config and scope rules with files globs. For
example, this checks test files for skipped or exclusive tests while allowing
todo:
import noMistakes from "eslint-plugin-no-mistakes";
export default [
{
files: ["**/*.test.*", "tests/**"],
plugins: { "no-mistakes": noMistakes },
rules: { "no-mistakes/test-no-skips": ["error", { allow: ["todo"] }] },
},
];See test-no-skips for the rule's
behavior and configuration, and the ESLint rule index
for the complete list.
To cap long Vitest timeouts, enable no-mistakes/vitest-timeout-cap in the
test and Vitest config files selected by your flat-config globs. It defaults to
5,000 ms for configured test and hook timeouts and 30,000 ms for per-test and
hook overrides. Overrides above the default cap require an adjacent
// no-mistakes-timeout-reason: <specific reason> comment.
See the rule documentation
for options and examples.
gh-api-argument-safety is an opt-in rule for structured endpoint fields and explicit API methods.
See options and examples.
no-argv-main-guard is an opt-in rule for symlink-sensitive entrypoint comparisons.
See options and examples.
no-locale-less-date-format is an opt-in rule requiring explicit locale arguments
for formatting methods and configured constructors. Scope it with flat-config
files/ignores. See the
options and examples.
no-comment-phrases is an opt-in rule for configured phrases in line and block comments.
See options and examples.
forbidden-member-chains is an opt-in rule for configured static member-access chains.
See options and examples.
playwright-no-swallowed-visibility is an opt-in rule for Playwright state checks whose rejection becomes a boolean literal.
See options and examples.
no-object-mutation is deprecated with no replacement. Existing opt-in
configurations keep reporting shared object writes and mutating calls.
See options and examples.
postgres-no-async-sql-builder is an opt-in rule for async SQL builders that never wait.
It suggests removing async only when the visible contract allows a synchronous return, and it never autofixes.
See options and examples.
postgres-pool-requires-error-listener is an opt-in rule for node-postgres pools
without a same-module idle-client error listener. Compatible module names can
be added with extraModules.
See options and examples.
require-options-on-imported-call requires a static options object on configured
imports, globals with no local binding, and terminal methods with a matching receiver shape.
See options and examples.
restricted-api-usage is an opt-in import/export-name and call-name policy.
See options and examples.
Opt-in client contracts: no-consecutive-unbatched-reads configures adjacent awaited read batching; require-top-level-registration configures owner-module lifecycle registration. Both support ESLint/Oxlint and have no product defaults.
no-top-level-await is an opt-in rule for asynchronous module evaluation.
See options and examples.
