Skip to content

Commit

Permalink
ESLint: Skip no-undef for TypeScript
Browse files Browse the repository at this point in the history
ESLint doesn't recognize TypeScript built-ins.  This is fine, as the
TypeScript compiler will error out on undefined variables.

Signed-off-by: Mark Yen <[email protected]>
  • Loading branch information
mook-as committed May 12, 2021
1 parent 1f2af23 commit 3228cdd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,14 @@ Object.assign(module.exports.rules, {
// Allow using `any` in TypeScript, until the whole project is converted.
'@typescript-eslint/no-explicit-any': 'off',
});

module.exports.overrides = [
{
files: ['*.ts'],
rules: {
// For TypeScript, disable no-undef because the compiler checks it.
// Also, it is unaware of TypeScript types.
'no-undef': 'off',
}
}
];

0 comments on commit 3228cdd

Please sign in to comment.