diff --git a/static/.eslintrc.json b/static/.eslintrc.json new file mode 100644 index 0000000000..a9335eca72 --- /dev/null +++ b/static/.eslintrc.json @@ -0,0 +1,8 @@ +{ + "env": { + "browser": true + }, + "rules": { + "no-console": "error" + } +} diff --git a/static/js/.eslintrc.json b/static/js/.eslintrc.json deleted file mode 100644 index b99c1118dd..0000000000 --- a/static/js/.eslintrc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "env": { - "browser": true - } -} diff --git a/static/js/blueslip.js b/static/js/blueslip.js index 80c58958df..2cc1e996f2 100644 --- a/static/js/blueslip.js +++ b/static/js/blueslip.js @@ -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 diff --git a/static/js/debug.js b/static/js/debug.js index e5c0049755..7f60a07e0d 100644 --- a/static/js/debug.js +++ b/static/js/debug.js @@ -1,3 +1,5 @@ +/* eslint-disable no-console */ + /* WARNING: This file is only included when Django's DEBUG = True and your diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py index 9a4ad73eda..e2f09b2d68 100644 --- a/tools/linter_lib/custom_check.py +++ b/tools/linter_lib/custom_check.py @@ -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/'])},