lint: Check for occurrences of .includes except in frontend_tests/.

Adds a custom check to js_rules in `/tools/lint/lib/custom_check.py`.
This commit is contained in:
Shubham Padia
2018-06-04 01:30:04 +05:30
committed by Tim Abbott
parent f6f4a3f50a
commit e32dd53cd9

View File

@@ -188,6 +188,9 @@ def build_custom_checkers(by_lang):
'description': 'Do not concatenate i18n strings'},
{'pattern': '\+.*i18n\.t\(.+\)',
'description': 'Do not concatenate i18n strings'},
{'pattern': '[.]includes[(]',
'exclude': ['frontend_tests/'],
'description': '.includes() is incompatible with Internet Explorer. Use .indexOf() !== -1 instead.'},
{'pattern': '[.]html[(]',
'exclude_pattern': '[.]html[(]("|\'|templates|html|message.content|sub.rendered_description|i18n.t|rendered_|$|[)]|error_text|widget_elem|[$]error|[$][(]"<p>"[)])',
'exclude': ['static/js/portico', 'static/js/lightbox.js', 'static/js/ui_report.js',