mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
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:
committed by
Tim Abbott
parent
f6f4a3f50a
commit
e32dd53cd9
@@ -188,6 +188,9 @@ def build_custom_checkers(by_lang):
|
|||||||
'description': 'Do not concatenate i18n strings'},
|
'description': 'Do not concatenate i18n strings'},
|
||||||
{'pattern': '\+.*i18n\.t\(.+\)',
|
{'pattern': '\+.*i18n\.t\(.+\)',
|
||||||
'description': 'Do not concatenate i18n strings'},
|
'description': 'Do not concatenate i18n strings'},
|
||||||
|
{'pattern': '[.]includes[(]',
|
||||||
|
'exclude': ['frontend_tests/'],
|
||||||
|
'description': '.includes() is incompatible with Internet Explorer. Use .indexOf() !== -1 instead.'},
|
||||||
{'pattern': '[.]html[(]',
|
{'pattern': '[.]html[(]',
|
||||||
'exclude_pattern': '[.]html[(]("|\'|templates|html|message.content|sub.rendered_description|i18n.t|rendered_|$|[)]|error_text|widget_elem|[$]error|[$][(]"<p>"[)])',
|
'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',
|
'exclude': ['static/js/portico', 'static/js/lightbox.js', 'static/js/ui_report.js',
|
||||||
|
|||||||
Reference in New Issue
Block a user