Skip to content

Commit

Permalink
fix: turn off no-undef for ts files (#229)
Browse files Browse the repository at this point in the history
`tsc` already handles erroring on undefined variables so the check
does nothing.

`typescript-eslint` [recommends disabling it](https://typescript-eslint.io/troubleshooting/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors).
  • Loading branch information
achingbrain committed Jun 21, 2024
1 parent 170ba8f commit c9ccaeb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module.exports = {
'no-return-await': 'off', // disable this rule to use @typescript-eslint/return-await instead
'@typescript-eslint/return-await': ['error', 'in-try-catch'], // require awaiting thenables returned from try/catch
'jsdoc/require-param': 'off', // do not require jsdoc for params
'jsdoc/require-param-type': 'off' // allow compiler to derive param type
'jsdoc/require-param-type': 'off', // allow compiler to derive param type
'no-undef': 'off' // typescript already checks for undefined variables so this is redundant - https://typescript-eslint.io/troubleshooting/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
}
}

0 comments on commit c9ccaeb

Please sign in to comment.