Files
triggerdotdev--trigger.dev/.oxlintrc.json
T
claude[bot] de536622c8 Add oxlint rule to catch thrown un-awaited redirect helpers (#4222)
##  Checklist

- [x] I have followed every step in the [contributing
guide](https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md)
- [x] The PR title follows the convention.
- [x] I ran and tested the code works

---

## Testing

- Verified the rule emits exactly five errors for un-awaited throws of
the known
async redirect helpers while ignoring awaited throws, returned promises,
and
  synchronous `redirect(...)`.
- Verified `--fix` inserts `await` in async functions and produces a
clean
  second lint run.
- Verified synchronous functions remain diagnostic-only so autofix
cannot
  introduce invalid syntax.
- Ran `pnpm run format`, `pnpm run lint`,
  `pnpm run typecheck --filter webapp`, and `git diff --check`.

---

## Changelog

Adds an Oxlint rule that prevents async redirect helpers from being
thrown
without awaiting their `Response`. Existing violations are fixed, the
autofix
is limited to async functions, and the plugin uses an explicit ESM
extension.

---

## Screenshots

See the test-results comment for CLI evidence.

💯


Link to Devin session:
https://app.devin.ai/sessions/e60ad7610773401da3d3040cf1252337
Requested by: @ericallam

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Eric Allam <eric@trigger.dev>
2026-07-10 13:19:13 +02:00

39 lines
1.1 KiB
JSON

{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["typescript", "import", "react"],
"jsPlugins": ["./oxlint-plugins/no-thrown-unawaited-redirect.mjs"],
"ignorePatterns": [
"**/dist/**",
"**/build/**",
"**/*.d.ts",
"**/seed.js",
"**/seedCloud.ts",
"**/populate.js",
"internal-packages/tsql/src/grammar/"
],
"rules": {
"no-unused-vars": [
"error",
{
"args": "none",
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrors": "all",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"ignoreRestSiblings": true
}
],
"no-empty-pattern": "off",
"no-control-regex": "off",
"typescript/no-non-null-asserted-optional-chain": "off",
"no-unused-expressions": ["warn", { "allowShortCircuit": true, "allowTernary": true }],
"typescript/consistent-type-imports": "error",
"import/no-duplicates": "error",
"import/namespace": "off",
"react-hooks/exhaustive-deps": "off",
"react-hooks/rules-of-hooks": "off",
"trigger/no-thrown-unawaited-redirect": "error"
}
}