[eslint] Ignore _ prefixed unused variables

This commit is contained in:
Lauren Tan
2023-02-27 17:12:38 -05:00
parent 60137a8b64
commit e4e1af7236
+11 -4
View File
@@ -29,10 +29,17 @@ module.exports = {
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/explicit-function-return-type": "error",
// Unused variables are frequently a bug. Ideally this rule would ignore identifiers
// prefixed with "_", though, so that we don't need suppressions in legit cases.
// TODO: build a custom version of this rule that understands "_" as a prefix.
"@typescript-eslint/no-unused-vars": "error",
// Unused variables are frequently a bug. Prefix unused variables with an _ to fix, but note
// that eslint won't warn you that an underscore prefixed variable is used and that the prefix
// should be dropped.
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
// Consider enabling for consistency. Ideally violations could be auto-fixed.
"@typescript-eslint/consistent-generic-constructors": [