lint: Delegate console.log check to ESLint.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2020-02-06 02:21:18 +00:00
committed by Tim Abbott
parent 0c8d199a3d
commit b3f63262af
5 changed files with 12 additions and 12 deletions

8
static/.eslintrc.json Normal file
View File

@@ -0,0 +1,8 @@
{
"env": {
"browser": true
},
"rules": {
"no-console": "error"
}
}

View File

@@ -1,5 +0,0 @@
{
"env": {
"browser": true
}
}

View File

@@ -1,3 +1,5 @@
/* eslint-disable no-console */
// System documented in https://zulip.readthedocs.io/en/latest/subsystems/logging.html
// This must be included before the first call to $(document).ready

View File

@@ -1,3 +1,5 @@
/* eslint-disable no-console */
/* WARNING:
This file is only included when Django's DEBUG = True and your

View File

@@ -156,13 +156,6 @@ js_rules = RuleList(
'description': 'Write JS else statements on same line as }'},
{'pattern': '^else if',
'description': 'Write JS else statements on same line as }'},
{'pattern': 'console[.][a-z]',
'exclude': set(['static/js/blueslip.js',
'frontend_tests/zjsunit',
'frontend_tests/casper_lib/common.js',
'frontend_tests/node_tests',
'static/js/debug.js']),
'description': 'console.log and similar should not be used in webapp'},
{'pattern': r'''[.]text\(["'][a-zA-Z]''',
'description': 'Strings passed to $().text should be wrapped in i18n.t() for internationalization',
'exclude': set(['frontend_tests/node_tests/'])},