Add linter for naked console.errors

Summary:
`console.error(err)` are hard to identify in the codebase especially
as we often don't have reliable stack trace information.

I've already cleaned up a bunch of them manually by going after the most
high-firing ones; this should make it easier to identify the remaining ones.

Reviewed By: jknoxville

Differential Revision: D27913964

fbshipit-source-id: 0ff6624a0c083829846550b40954945d655b7cf6
This commit is contained in:
Pascal Hartig
2021-04-22 05:20:56 -07:00
committed by Facebook GitHub Bot
parent 87cdd21951
commit 3431206c0e
4 changed files with 121 additions and 0 deletions

View File

@@ -13,10 +13,14 @@ import noRelativeImportsAcrossPackages, {
import noElectronRemoteImports, {
RULE_NAME as noElectronRemoteImportsRuleName,
} from './rules/noElectronRemoteImports';
import noConsoleErrorWithoutContext, {
RULE_NAME as noConsoleErrorWithoutContextRuleName,
} from './rules/noConsoleErrorWithoutContext';
module.exports = {
rules: {
[noRelativeImportsAcrossPackagesRuleName]: noRelativeImportsAcrossPackages,
[noElectronRemoteImportsRuleName]: noElectronRemoteImports,
[noConsoleErrorWithoutContextRuleName]: noConsoleErrorWithoutContext,
},
};