ESLint: Skip no-undef for TypeScript

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 <mark.yen@suse.com>
This commit is contained in:
Mark Yen
2021-05-05 10:04:29 -07:00
parent 1f2af23324
commit 3228cdd0ad

View File

@@ -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',
}
}
];