Skip to content
All changes

Feature

dev-configs Adds Opt-In Async Style Lint Rules and a Codemod

@venizia/dev-configs

Changelog - 2026-10-31 ​

Async style lint rules and a codemod ​

New Feature

In one line. After updating @venizia/dev-configs you can turn on four rules that keep await on its own line, stop return await, and keep async functions out of React hooks; nothing changes until you spread the new config arrays: asyncStyleConfigs for the two await rules, reactAsyncStyleConfigs for the two hook rules.

What changed ​

  • venizia/no-inline-await. await is a whole statement or the whole initializer of a declaration, never inside a call, a ternary, a template literal or an assignment. Test files follow it too.
  • venizia/no-return-await. return await f() becomes return f(); inside try, catch or finally it becomes const result = await f(); return result;.
  • venizia/no-async-hook-callback. No use... call receives an async function: not as an argument, and not nested in an object or array argument either (useMutation({ mutationFn: async () => {} }) is reported). A sync callback that builds an async function inside is left alone.
  • venizia/effect-cleanup-consistency. An effect callback returns nothing on every path or a cleanup on every path.
  • devz codemod async-style. Applies the fixes of the first two rules across a codebase (a dry run unless --write; --check exits 1 when anything is left) and lists what it cannot fix, with file and line. With --write it refuses a file that has local changes (modified, staged or untracked) and prints refused <file> has local changes: commit or stash it, then run again.

How to turn them on ​

javascript
// .configs/lints/eslint.config.mjs
import { asyncStyleConfigs, houseConfigs } from '@venizia/dev-configs/linters';

export default [...houseConfigs, ...asyncStyleConfigs];

asyncStyleConfigs holds no-inline-await and no-return-await; the two hook rules are not in it. A React project spreads reactHouseConfigs and reactAsyncStyleConfigs, which holds no-async-hook-callback and effect-cleanup-consistency, and spreads asyncStyleConfigs as well when it also wants the two await rules. The rules are at error. A later release will include them in houseConfigs and reactHouseConfigs; the two new exports will stay as aliases.

Who is affected ​

  • Projects that update and change nothing. No action needed: the rules are off.
  • Projects that turn them on. Run devz codemod async-style <package> to see the plan, commit your work, then run it again with --write; what it cannot fix is listed for you to fix by hand. See Async Style.