2016-11-04 23:15:18 +01:00
|
|
|
|
{
|
|
|
|
|
"env": {
|
2017-05-25 01:44:58 +02:00
|
|
|
|
"node": true,
|
|
|
|
|
"es6": true
|
|
|
|
|
},
|
|
|
|
|
"parserOptions": {
|
2019-12-07 02:51:48 +01:00
|
|
|
|
"ecmaVersion": 2019,
|
2019-06-04 02:49:59 +02:00
|
|
|
|
"warnOnUnsupportedTypeScriptVersion": false,
|
2017-05-25 01:44:58 +02:00
|
|
|
|
"sourceType": "module"
|
2016-11-04 23:15:18 +01:00
|
|
|
|
},
|
|
|
|
|
"globals": {
|
|
|
|
|
"$": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"ClipboardJS": false,
|
|
|
|
|
"Dict": false,
|
|
|
|
|
"FetchStatus": false,
|
|
|
|
|
"Filter": false,
|
2016-11-29 17:59:32 +01:00
|
|
|
|
"Handlebars": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"LightboxCanvas": false,
|
|
|
|
|
"MessageListData": false,
|
|
|
|
|
"MessageListView": false,
|
|
|
|
|
"Plotly": false,
|
|
|
|
|
"Sortable": false,
|
|
|
|
|
"WinChan": false,
|
|
|
|
|
"XDate": false,
|
|
|
|
|
"_": false,
|
|
|
|
|
"activity": false,
|
|
|
|
|
"admin": false,
|
|
|
|
|
"alert_words": false,
|
|
|
|
|
"alert_words_ui": false,
|
|
|
|
|
"attachments_ui": false,
|
|
|
|
|
"avatar": false,
|
2019-01-02 09:12:19 +01:00
|
|
|
|
"billing": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"blueslip": false,
|
|
|
|
|
"bot_data": false,
|
|
|
|
|
"bridge": false,
|
|
|
|
|
"buddy_data": false,
|
|
|
|
|
"buddy_list": false,
|
|
|
|
|
"channel": false,
|
|
|
|
|
"click_handlers": false,
|
2018-11-28 22:07:14 +01:00
|
|
|
|
"color_data": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"colorspace": false,
|
|
|
|
|
"common": false,
|
|
|
|
|
"components": false,
|
|
|
|
|
"compose": false,
|
|
|
|
|
"compose_actions": false,
|
|
|
|
|
"compose_fade": false,
|
|
|
|
|
"compose_pm_pill": false,
|
|
|
|
|
"compose_state": false,
|
|
|
|
|
"compose_ui": false,
|
|
|
|
|
"composebox_typeahead": false,
|
|
|
|
|
"condense": false,
|
2018-09-12 17:43:38 +02:00
|
|
|
|
"confirm_dialog": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"copy_and_paste": false,
|
|
|
|
|
"csrf_token": false,
|
|
|
|
|
"current_msg_list": true,
|
|
|
|
|
"drafts": false,
|
|
|
|
|
"echo": false,
|
|
|
|
|
"emoji": false,
|
|
|
|
|
"emoji_codes": false,
|
|
|
|
|
"emoji_picker": false,
|
|
|
|
|
"favicon": false,
|
|
|
|
|
"feature_flags": false,
|
2018-12-21 15:58:28 +01:00
|
|
|
|
"feedback_widget": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"fenced_code": false,
|
|
|
|
|
"flatpickr": false,
|
|
|
|
|
"floating_recipient_bar": false,
|
|
|
|
|
"gear_menu": false,
|
|
|
|
|
"hash_util": false,
|
|
|
|
|
"hashchange": false,
|
2019-01-02 09:12:19 +01:00
|
|
|
|
"helpers": false,
|
2019-02-27 12:52:05 +01:00
|
|
|
|
"history": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"home_msg_list": false,
|
|
|
|
|
"hotspots": false,
|
|
|
|
|
"i18n": false,
|
|
|
|
|
"info_overlay": false,
|
|
|
|
|
"input_pill": false,
|
|
|
|
|
"invite": false,
|
|
|
|
|
"jQuery": false,
|
|
|
|
|
"katex": false,
|
|
|
|
|
"keydown_util": false,
|
|
|
|
|
"lightbox": false,
|
|
|
|
|
"list_cursor": false,
|
|
|
|
|
"list_render": false,
|
|
|
|
|
"list_util": false,
|
|
|
|
|
"loading": false,
|
|
|
|
|
"localStorage": false,
|
|
|
|
|
"local_message": false,
|
|
|
|
|
"localstorage": false,
|
2019-02-27 12:52:05 +01:00
|
|
|
|
"location": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"markdown": false,
|
2016-11-29 17:59:32 +01:00
|
|
|
|
"marked": false,
|
2017-11-03 17:25:47 +01:00
|
|
|
|
"md5": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"message_edit": false,
|
|
|
|
|
"message_events": false,
|
|
|
|
|
"message_fetch": false,
|
|
|
|
|
"message_flags": false,
|
|
|
|
|
"message_list": false,
|
|
|
|
|
"message_live_update": false,
|
|
|
|
|
"message_scroll": false,
|
|
|
|
|
"message_store": false,
|
|
|
|
|
"message_util": false,
|
|
|
|
|
"message_viewport": false,
|
2017-04-02 00:07:03 +02:00
|
|
|
|
"moment": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"muting": false,
|
|
|
|
|
"muting_ui": false,
|
|
|
|
|
"narrow": false,
|
|
|
|
|
"narrow_state": false,
|
|
|
|
|
"navigate": false,
|
|
|
|
|
"night_mode": false,
|
|
|
|
|
"notifications": false,
|
|
|
|
|
"overlays": false,
|
|
|
|
|
"padded_widget": false,
|
2016-11-29 17:59:32 +01:00
|
|
|
|
"page_params": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"panels": false,
|
|
|
|
|
"people": false,
|
|
|
|
|
"pm_conversations": false,
|
|
|
|
|
"pm_list": false,
|
pm_list: Simplify redraws for Private Messages.
We now use vdom-ish techniques to track the
list items for the pm list. When we go to update
the list, we only re-render nodes whose data
has changed, with two exceptions:
- Obviously, the first time we do a full render.
- If the keys for the items have changed (i.e.
a new node has come in or the order has changed),
we just re-render the whole list.
If the keys are the same since the last re-render, we
only re-render individual items if their data has
changed.
Most of the new code is in these two modules:
- pm_list_dom.js
- vdom.js
We remove all of the code in pm_list.js that is
related to updating DOM with unread counts.
For presence updates, we are now *never*
re-rendering the whole list, since presence
updates only change individual line items and
don't affect the keys. Instead, we just update
any changed elements in place.
The main thing that makes this all work is the
`update` method in `vdom`, which is totally generic
and essentially does a few simple jobs:
- detect if keys are different
- just render the whole ul as needed
- for items that change, do the appropriate
jQuery to update the item in place
Note that this code seems to play nice with simplebar.
Also, this code continues to use templates to render
the individual list items.
FWIW this code isn't radically different than list_render,
but it's got some key differences:
- There are fewer bells and whistles in this code.
Some of the stuff that list_render does is overkill
for the PM list.
- This code detects data changes.
Note that the vdom scheme is agnostic about templates;
it simply requires the child nodes to provide a render
method. (This is similar to list_render, which is also
technically agnostic about rendering, but which also
does use templates in most cases.)
These fixes are somewhat related to #13605, but we
haven't gotten a solid repro on that issue, and
the scrolling issues there may be orthogonal to the
redraws. But having fewer moving parts here should
help, and we won't get the rug pulled out from under
us on every presence update.
There are two possible extensions to this that are
somewhat overlapping in nature, but can be done
one a time.
* We can do a deeper vdom approach here that
gets us away from templates, and just have
nodes write to an AST. I have this on another
branch, but it might be overkill.
* We can avoid some redraws by detecting where
keys are moving up and down. I'm not completely
sure we need it for the PM list.
If this gets merged, we may want to try similar
things for the stream list, which also does a fairly
complicated mixture of big-hammer re-renders and
surgical updates-in-place (with custom code).
BTW we have 100% line coverage for vdom.js.
2020-01-04 17:17:44 +01:00
|
|
|
|
"pm_list_dom": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"pointer": false,
|
2016-11-29 17:59:32 +01:00
|
|
|
|
"popovers": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"presence": false,
|
|
|
|
|
"pygments_data": false,
|
|
|
|
|
"reactions": false,
|
|
|
|
|
"realm_icon": false,
|
2018-08-16 01:26:55 +02:00
|
|
|
|
"realm_logo": false,
|
2019-01-27 08:25:10 +01:00
|
|
|
|
"realm_night_logo": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"recent_senders": false,
|
|
|
|
|
"reload": false,
|
2018-08-04 15:40:25 +02:00
|
|
|
|
"reload_state": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"reminder": false,
|
|
|
|
|
"resize": false,
|
|
|
|
|
"rows": false,
|
|
|
|
|
"rtl": false,
|
|
|
|
|
"run_test": false,
|
|
|
|
|
"schema": false,
|
|
|
|
|
"scroll_bar": false,
|
|
|
|
|
"scroll_util": false,
|
|
|
|
|
"search": false,
|
|
|
|
|
"search_pill": false,
|
|
|
|
|
"search_pill_widget": false,
|
|
|
|
|
"search_suggestion": false,
|
|
|
|
|
"search_util": false,
|
|
|
|
|
"sent_messages": false,
|
2016-11-29 17:59:32 +01:00
|
|
|
|
"server_events": false,
|
2017-05-31 08:53:09 +02:00
|
|
|
|
"server_events_dispatch": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"settings": false,
|
2017-04-06 02:28:57 +02:00
|
|
|
|
"settings_account": false,
|
2017-04-06 22:47:27 +02:00
|
|
|
|
"settings_bots": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"settings_display": false,
|
2017-04-08 17:24:07 +02:00
|
|
|
|
"settings_emoji": false,
|
2019-04-09 21:49:07 +02:00
|
|
|
|
"settings_exports": false,
|
2018-12-17 21:28:25 +01:00
|
|
|
|
"settings_linkifiers": false,
|
2017-10-21 03:15:12 +02:00
|
|
|
|
"settings_invites": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"settings_muting": false,
|
|
|
|
|
"settings_notifications": false,
|
|
|
|
|
"settings_org": false,
|
|
|
|
|
"settings_panel_menu": false,
|
2017-12-14 05:51:45 +01:00
|
|
|
|
"settings_profile_fields": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"settings_sections": false,
|
|
|
|
|
"settings_streams": false,
|
|
|
|
|
"settings_toggle": false,
|
|
|
|
|
"settings_ui": false,
|
|
|
|
|
"settings_user_groups": false,
|
|
|
|
|
"settings_users": false,
|
2018-08-17 03:46:32 +02:00
|
|
|
|
"starred_messages": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"stream_color": false,
|
2017-04-22 22:22:25 +02:00
|
|
|
|
"stream_create": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"stream_data": false,
|
2017-04-24 04:11:25 +02:00
|
|
|
|
"stream_edit": false,
|
2017-03-19 16:03:07 +01:00
|
|
|
|
"stream_events": false,
|
2016-11-29 17:59:32 +01:00
|
|
|
|
"stream_list": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"stream_muting": false,
|
2017-03-05 17:28:40 +01:00
|
|
|
|
"stream_popover": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"stream_sort": false,
|
2019-04-02 17:07:37 +02:00
|
|
|
|
"stream_ui_updates": false,
|
2019-01-08 18:06:06 +01:00
|
|
|
|
"StripeCheckout": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"submessage": false,
|
|
|
|
|
"subs": false,
|
2016-11-29 17:59:32 +01:00
|
|
|
|
"tab_bar": false,
|
|
|
|
|
"templates": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"tictactoe_widget": false,
|
|
|
|
|
"timerender": false,
|
|
|
|
|
"todo_widget": false,
|
|
|
|
|
"top_left_corner": false,
|
|
|
|
|
"topic_data": false,
|
|
|
|
|
"topic_generator": false,
|
|
|
|
|
"topic_list": false,
|
2018-09-10 14:52:58 +02:00
|
|
|
|
"topic_zoom": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"transmit": false,
|
|
|
|
|
"tutorial": false,
|
|
|
|
|
"typeahead_helper": false,
|
|
|
|
|
"typing": false,
|
|
|
|
|
"typing_data": false,
|
|
|
|
|
"typing_events": false,
|
|
|
|
|
"ui": false,
|
2018-12-26 19:56:19 +01:00
|
|
|
|
"ui_init": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"ui_report": false,
|
|
|
|
|
"ui_util": false,
|
|
|
|
|
"unread": false,
|
2017-03-18 01:41:56 +01:00
|
|
|
|
"unread_ops": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"unread_ui": false,
|
2019-01-02 09:12:19 +01:00
|
|
|
|
"upgrade": false,
|
2017-11-23 15:00:05 +01:00
|
|
|
|
"upload": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"upload_widget": false,
|
2017-01-21 16:49:27 +01:00
|
|
|
|
"user_events": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"user_groups": false,
|
|
|
|
|
"user_pill": false,
|
|
|
|
|
"user_search": false,
|
2018-12-19 17:11:17 +01:00
|
|
|
|
"user_status": false,
|
2019-01-26 21:14:33 +01:00
|
|
|
|
"user_status_ui": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"util": false,
|
2018-12-17 04:46:27 +01:00
|
|
|
|
"poll_widget": false,
|
pm_list: Simplify redraws for Private Messages.
We now use vdom-ish techniques to track the
list items for the pm list. When we go to update
the list, we only re-render nodes whose data
has changed, with two exceptions:
- Obviously, the first time we do a full render.
- If the keys for the items have changed (i.e.
a new node has come in or the order has changed),
we just re-render the whole list.
If the keys are the same since the last re-render, we
only re-render individual items if their data has
changed.
Most of the new code is in these two modules:
- pm_list_dom.js
- vdom.js
We remove all of the code in pm_list.js that is
related to updating DOM with unread counts.
For presence updates, we are now *never*
re-rendering the whole list, since presence
updates only change individual line items and
don't affect the keys. Instead, we just update
any changed elements in place.
The main thing that makes this all work is the
`update` method in `vdom`, which is totally generic
and essentially does a few simple jobs:
- detect if keys are different
- just render the whole ul as needed
- for items that change, do the appropriate
jQuery to update the item in place
Note that this code seems to play nice with simplebar.
Also, this code continues to use templates to render
the individual list items.
FWIW this code isn't radically different than list_render,
but it's got some key differences:
- There are fewer bells and whistles in this code.
Some of the stuff that list_render does is overkill
for the PM list.
- This code detects data changes.
Note that the vdom scheme is agnostic about templates;
it simply requires the child nodes to provide a render
method. (This is similar to list_render, which is also
technically agnostic about rendering, but which also
does use templates in most cases.)
These fixes are somewhat related to #13605, but we
haven't gotten a solid repro on that issue, and
the scrolling issues there may be orthogonal to the
redraws. But having fewer moving parts here should
help, and we won't get the rug pulled out from under
us on every presence update.
There are two possible extensions to this that are
somewhat overlapping in nature, but can be done
one a time.
* We can do a deeper vdom approach here that
gets us away from templates, and just have
nodes write to an AST. I have this on another
branch, but it might be overkill.
* We can avoid some redraws by detecting where
keys are moving up and down. I'm not completely
sure we need it for the PM list.
If this gets merged, we may want to try similar
things for the stream list, which also does a fairly
complicated mixture of big-hammer re-renders and
surgical updates-in-place (with custom code).
BTW we have 100% line coverage for vdom.js.
2020-01-04 17:17:44 +01:00
|
|
|
|
"vdom": false,
|
2018-02-23 16:20:33 +01:00
|
|
|
|
"widgetize": false,
|
2018-08-03 19:17:46 +02:00
|
|
|
|
"zcommand": false,
|
|
|
|
|
"zform": false,
|
|
|
|
|
"zxcvbn": false
|
2016-11-04 23:15:18 +01:00
|
|
|
|
},
|
2018-03-13 13:04:16 +01:00
|
|
|
|
"plugins": [
|
|
|
|
|
"eslint-plugin-empty-returns"
|
|
|
|
|
],
|
2016-11-04 23:15:18 +01:00
|
|
|
|
"rules": {
|
2016-12-05 07:53:36 +01:00
|
|
|
|
"array-callback-return": "error",
|
2017-10-06 21:43:12 +02:00
|
|
|
|
"array-bracket-spacing": "error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"arrow-spacing": [ "error", { "before": true, "after": true } ],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"block-scoped-var": "error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"brace-style": [ "error", "1tbs", { "allowSingleLine": true } ],
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"camelcase": "off",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"comma-dangle": [ "error",
|
|
|
|
|
{
|
|
|
|
|
"arrays": "always-multiline",
|
|
|
|
|
"objects": "always-multiline",
|
|
|
|
|
"imports": "always-multiline",
|
|
|
|
|
"exports": "always-multiline",
|
|
|
|
|
"functions": "never"
|
|
|
|
|
}
|
|
|
|
|
],
|
2018-12-07 21:21:39 +01:00
|
|
|
|
"comma-spacing": [ "error",
|
|
|
|
|
{
|
|
|
|
|
"before": false,
|
|
|
|
|
"after": true
|
|
|
|
|
}
|
|
|
|
|
],
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"complexity": [ "off", 4 ],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"curly": "error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"dot-notation": [ "error", { "allowKeywords": true } ],
|
2018-03-13 13:04:16 +01:00
|
|
|
|
"empty-returns/main": "error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"eol-last": [ "error", "always" ],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"eqeqeq": "error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"func-style": [ "off", "expression" ],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"guard-for-in": "error",
|
2018-04-06 20:43:18 +02:00
|
|
|
|
"indent": ["error", 4, {
|
|
|
|
|
"ArrayExpression": "first",
|
|
|
|
|
"ObjectExpression": "first",
|
|
|
|
|
"SwitchCase": 0,
|
|
|
|
|
"CallExpression": {"arguments": "first"},
|
|
|
|
|
"FunctionExpression": {"parameters": "first"},
|
|
|
|
|
"FunctionDeclaration": {"parameters": "first"}
|
|
|
|
|
}],
|
2018-12-18 19:34:45 +01:00
|
|
|
|
"key-spacing": [ "error",
|
|
|
|
|
{
|
|
|
|
|
"beforeColon": false,
|
|
|
|
|
"afterColon": true
|
|
|
|
|
}
|
|
|
|
|
],
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"keyword-spacing": [ "error",
|
|
|
|
|
{
|
|
|
|
|
"before": true,
|
|
|
|
|
"after": true,
|
|
|
|
|
"overrides": {
|
|
|
|
|
"return": { "after": true },
|
|
|
|
|
"throw": { "after": true },
|
|
|
|
|
"case": { "after": true }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"max-depth": [ "off", 4 ],
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"max-len": [ "error", 100, 2,
|
|
|
|
|
{
|
|
|
|
|
"ignoreUrls": true,
|
|
|
|
|
"ignoreComments": false,
|
|
|
|
|
"ignoreRegExpLiterals": true,
|
|
|
|
|
"ignoreStrings": true,
|
|
|
|
|
"ignoreTemplateLiterals": true
|
|
|
|
|
}
|
|
|
|
|
],
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"max-params": [ "off", 3 ],
|
|
|
|
|
"max-statements": [ "off", 10 ],
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"new-cap": [ "error",
|
|
|
|
|
{
|
|
|
|
|
"newIsCap": true,
|
|
|
|
|
"capIsNew": false
|
|
|
|
|
}
|
|
|
|
|
],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"new-parens": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"newline-per-chained-call": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-alert": "error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"no-array-constructor": "error",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-bitwise": "error",
|
|
|
|
|
"no-caller": "error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"no-case-declarations": "error",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-catch-shadow": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"no-console": "off",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"no-const-assign": "error",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-control-regex": "error",
|
|
|
|
|
"no-debugger": "error",
|
|
|
|
|
"no-delete-var": "error",
|
|
|
|
|
"no-div-regex": "error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"no-dupe-class-members": "error",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-dupe-keys": "error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"no-duplicate-imports": "error",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-else-return": "error",
|
|
|
|
|
"no-empty": "error",
|
|
|
|
|
"no-empty-character-class": "error",
|
|
|
|
|
"no-eq-null": "error",
|
|
|
|
|
"no-eval": "error",
|
|
|
|
|
"no-ex-assign": "error",
|
2018-06-06 18:50:09 +02:00
|
|
|
|
"no-extra-parens": ["error", "all"],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-extra-semi": "error",
|
|
|
|
|
"no-fallthrough": "error",
|
|
|
|
|
"no-floating-decimal": "error",
|
|
|
|
|
"no-func-assign": "error",
|
|
|
|
|
"no-implied-eval": "error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"no-iterator": "error",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-label-var": "error",
|
|
|
|
|
"no-labels": "error",
|
|
|
|
|
"no-loop-func": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"no-mixed-requires": [ "off", false ],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-multi-str": "error",
|
|
|
|
|
"no-native-reassign": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"no-nested-ternary": "off",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"no-new-func": "error",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-new-object": "error",
|
|
|
|
|
"no-new-wrappers": "error",
|
|
|
|
|
"no-obj-calls": "error",
|
|
|
|
|
"no-octal": "error",
|
|
|
|
|
"no-octal-escape": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"no-param-reassign": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-plusplus": "error",
|
|
|
|
|
"no-proto": "error",
|
|
|
|
|
"no-redeclare": "error",
|
|
|
|
|
"no-regex-spaces": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"no-restricted-syntax": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-return-assign": "error",
|
|
|
|
|
"no-script-url": "error",
|
|
|
|
|
"no-self-compare": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"no-shadow": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-sync": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"no-ternary": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-trailing-spaces": "error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"no-undef": "error",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-undef-init": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"no-underscore-dangle": "off",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"no-unneeded-ternary": [ "error", { "defaultAssignment": false } ],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-unreachable": "error",
|
|
|
|
|
"no-unused-expressions": "error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"no-unused-vars": [ "error",
|
|
|
|
|
{
|
|
|
|
|
"vars": "local",
|
|
|
|
|
"args": "after-used",
|
|
|
|
|
"varsIgnorePattern": "print_elapsed_time|check_duplicate_ids"
|
|
|
|
|
}
|
|
|
|
|
],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-use-before-define": "error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"no-useless-constructor": "error",
|
|
|
|
|
// The Zulip codebase complies partially with the "no-useless-escape"
|
|
|
|
|
// rule; only regex expressions haven't been updated yet.
|
|
|
|
|
// Updated regex expressions are currently being tested in casper
|
|
|
|
|
// files and will decide about a potential future enforcement of this rule.
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"no-useless-escape": "off",
|
2019-11-02 00:06:25 +01:00
|
|
|
|
"no-var": "error",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"space-unary-ops": "error",
|
|
|
|
|
"no-whitespace-before-property": "error",
|
|
|
|
|
"no-with": "error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"one-var": [ "error", "never" ],
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"padded-blocks": "off",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"prefer-const": [ "error",
|
|
|
|
|
{
|
|
|
|
|
"destructuring": "any",
|
|
|
|
|
"ignoreReadBeforeAssign": true
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"quote-props": [ "error", "as-needed",
|
|
|
|
|
{
|
|
|
|
|
"keywords": false,
|
|
|
|
|
"unnecessary": true,
|
|
|
|
|
"numbers": false
|
|
|
|
|
}
|
|
|
|
|
],
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"quotes": [ "off", "single" ],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"radix": "error",
|
|
|
|
|
"semi": "error",
|
|
|
|
|
"semi-spacing": ["error", {"before": false, "after": true}],
|
2019-10-30 20:13:53 +01:00
|
|
|
|
"sort-imports": "error",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"space-before-blocks": "error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"space-before-function-paren": [ "error",
|
|
|
|
|
{
|
|
|
|
|
"anonymous": "always",
|
|
|
|
|
"named": "never",
|
|
|
|
|
"asyncArrow": "always"
|
|
|
|
|
}
|
|
|
|
|
],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"space-in-parens": "error",
|
|
|
|
|
"space-infix-ops": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"spaced-comment": "off",
|
|
|
|
|
"strict": "off",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"template-curly-spacing": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"unnecessary-strict": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"use-isnan": "error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"valid-typeof": [ "error", { "requireStringLiterals": true } ],
|
|
|
|
|
"wrap-iife": [ "error", "outside", { "functionPrototypeMethods": false } ],
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"wrap-regex": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"yoda": "error"
|
2019-03-24 11:20:43 +01:00
|
|
|
|
},
|
|
|
|
|
"overrides": [
|
2019-11-02 00:06:25 +01:00
|
|
|
|
{
|
|
|
|
|
"files": [
|
|
|
|
|
"frontend_tests/casper_tests/*.js",
|
|
|
|
|
"frontend_tests/casper_lib/*.js"
|
|
|
|
|
],
|
|
|
|
|
"rules": {
|
|
|
|
|
"no-var": "off" // PhantomJS doesn’t support let, const
|
|
|
|
|
}
|
|
|
|
|
},
|
2019-03-24 11:20:43 +01:00
|
|
|
|
{
|
|
|
|
|
"files": ["**/*.ts"],
|
|
|
|
|
"parser": "@typescript-eslint/parser",
|
|
|
|
|
"parserOptions": {
|
2019-11-04 23:37:32 +01:00
|
|
|
|
"project": "tsconfig.json"
|
2019-03-24 11:20:43 +01:00
|
|
|
|
},
|
|
|
|
|
"plugins": ["@typescript-eslint"],
|
|
|
|
|
"rules": {
|
2019-05-31 07:15:00 +02:00
|
|
|
|
// Disable base rule to avoid conflict
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"empty-returns/main": "off",
|
|
|
|
|
"indent": "off",
|
|
|
|
|
"func-call-spacing": "off",
|
|
|
|
|
"no-magic-numbers": "off",
|
|
|
|
|
"semi": "off",
|
|
|
|
|
"no-unused-vars": "off",
|
2019-06-20 11:59:55 +02:00
|
|
|
|
"no-useless-constructor": "off",
|
2019-03-25 15:35:44 +01:00
|
|
|
|
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/adjacent-overload-signatures": "error",
|
|
|
|
|
"@typescript-eslint/array-type": "error",
|
|
|
|
|
"@typescript-eslint/await-thenable": "error",
|
|
|
|
|
"@typescript-eslint/ban-types": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"@typescript-eslint/ban-ts-ignore": "off",
|
|
|
|
|
"@typescript-eslint/camelcase": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/class-name-casing": "error",
|
2019-11-09 02:48:01 +01:00
|
|
|
|
"@typescript-eslint/consistent-type-assertions": "error",
|
2019-05-31 07:15:00 +02:00
|
|
|
|
"@typescript-eslint/explicit-function-return-type": ["error", { "allowExpressions": true }],
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"@typescript-eslint/explicit-member-accessibility": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/func-call-spacing": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"@typescript-eslint/generic-type-naming": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/indent": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"@typescript-eslint/interface-name-prefix": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/member-delimiter-style": "error",
|
2019-03-25 15:35:44 +01:00
|
|
|
|
"@typescript-eslint/member-naming": ["error", { "private": "^_" } ],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/member-ordering": "error",
|
|
|
|
|
"@typescript-eslint/no-array-constructor": "error",
|
|
|
|
|
"@typescript-eslint/no-empty-interface": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"@typescript-eslint/no-explicit-any": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/no-extraneous-class": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"@typescript-eslint/no-for-in-array": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/no-inferrable-types": "error",
|
2019-06-20 11:59:55 +02:00
|
|
|
|
"@typescript-eslint/no-magic-numbers": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/no-misused-new": "error",
|
|
|
|
|
"@typescript-eslint/no-namespace": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"@typescript-eslint/no-non-null-assertion": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/no-parameter-properties": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"@typescript-eslint/no-require-imports": "off",
|
|
|
|
|
"@typescript-eslint/no-this-alias": "off",
|
|
|
|
|
"@typescript-eslint/no-type-alias": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
|
|
|
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
2019-06-03 06:18:20 +02:00
|
|
|
|
"@typescript-eslint/no-unused-vars": ["error", { "varsIgnorePattern": "^_" } ],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/no-use-before-define": "error",
|
|
|
|
|
"@typescript-eslint/no-useless-constructor": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"@typescript-eslint/no-var-requires": "off",
|
|
|
|
|
"@typescript-eslint/prefer-for-of": "off",
|
|
|
|
|
"@typescript-eslint/prefer-function-type": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/prefer-includes": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"@typescript-eslint/prefer-interface": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/prefer-namespace-keyword": "error",
|
|
|
|
|
"@typescript-eslint/prefer-regexp-exec": "error",
|
|
|
|
|
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
|
|
|
|
"@typescript-eslint/promise-function-async": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"@typescript-eslint/restrict-plus-operands": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/semi": "error",
|
2019-11-09 02:48:01 +01:00
|
|
|
|
"@typescript-eslint/triple-slash-reference": "error",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/type-annotation-spacing": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"@typescript-eslint/unbound-method": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/unified-signatures": "error"
|
2019-03-24 11:20:43 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
2016-11-04 23:15:18 +01:00
|
|
|
|
}
|