2016-11-04 23:15:18 +01:00
|
|
|
|
{
|
|
|
|
|
"env": {
|
2020-07-24 04:33:22 +02:00
|
|
|
|
"es2020": true,
|
|
|
|
|
"node": true
|
2017-05-25 01:44:58 +02:00
|
|
|
|
},
|
2020-10-07 12:27:37 +02:00
|
|
|
|
"extends": [
|
|
|
|
|
"eslint:recommended",
|
|
|
|
|
"plugin:import/errors",
|
|
|
|
|
"plugin:import/warnings",
|
|
|
|
|
"plugin:unicorn/recommended",
|
|
|
|
|
"prettier"
|
|
|
|
|
],
|
2020-08-13 02:22:08 +02:00
|
|
|
|
"parser": "@babel/eslint-parser",
|
2017-05-25 01:44:58 +02:00
|
|
|
|
"parserOptions": {
|
2019-06-04 02:49:59 +02:00
|
|
|
|
"warnOnUnsupportedTypeScriptVersion": false,
|
2020-08-01 03:43:15 +02:00
|
|
|
|
"sourceType": "unambiguous"
|
2016-11-04 23:15:18 +01:00
|
|
|
|
},
|
2020-12-11 03:08:45 +01:00
|
|
|
|
"reportUnusedDisableDirectives": true,
|
2016-11-04 23:15:18 +01:00
|
|
|
|
"rules": {
|
2016-12-05 07:53:36 +01:00
|
|
|
|
"array-callback-return": "error",
|
2020-07-02 01:41:40 +02:00
|
|
|
|
"arrow-body-style": "error",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"block-scoped-var": "error",
|
2020-09-24 07:50:36 +02:00
|
|
|
|
"consistent-return": "error",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"curly": "error",
|
2020-05-27 03:58:32 +02:00
|
|
|
|
"dot-notation": "error",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"eqeqeq": "error",
|
|
|
|
|
"guard-for-in": "error",
|
2020-08-29 04:31:23 +02:00
|
|
|
|
"import/extensions": "error",
|
2020-07-24 06:02:07 +02:00
|
|
|
|
"import/first": "error",
|
|
|
|
|
"import/newline-after-import": "error",
|
2020-09-01 22:55:28 +02:00
|
|
|
|
"import/no-useless-path-segments": "error",
|
2020-07-24 06:02:07 +02:00
|
|
|
|
"import/order": [
|
|
|
|
|
"error",
|
|
|
|
|
{
|
|
|
|
|
"alphabetize": {"order": "asc"},
|
|
|
|
|
"newlines-between": "always"
|
|
|
|
|
}
|
|
|
|
|
],
|
2020-08-01 03:43:15 +02:00
|
|
|
|
"import/unambiguous": "error",
|
2021-02-09 22:46:25 +01:00
|
|
|
|
"lines-around-directive": "error",
|
2020-12-11 04:26:23 +01:00
|
|
|
|
"new-cap": "error",
|
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",
|
|
|
|
|
"no-catch-shadow": "error",
|
2020-05-27 03:58:32 +02:00
|
|
|
|
"no-constant-condition": ["error", {"checkLoops": false}],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-div-regex": "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-eq-null": "error",
|
|
|
|
|
"no-eval": "error",
|
2020-10-07 12:54:16 +02:00
|
|
|
|
"no-implicit-coercion": "error",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-implied-eval": "error",
|
2020-05-27 03:58:32 +02:00
|
|
|
|
"no-inner-declarations": "off",
|
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",
|
|
|
|
|
"no-multi-str": "error",
|
|
|
|
|
"no-native-reassign": "error",
|
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-octal-escape": "error",
|
|
|
|
|
"no-plusplus": "error",
|
|
|
|
|
"no-proto": "error",
|
|
|
|
|
"no-return-assign": "error",
|
|
|
|
|
"no-script-url": "error",
|
|
|
|
|
"no-self-compare": "error",
|
|
|
|
|
"no-sync": "error",
|
2020-10-07 13:01:09 +02:00
|
|
|
|
"no-throw-literal": "error",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-undef-init": "error",
|
2020-07-24 01:26:12 +02:00
|
|
|
|
"no-unneeded-ternary": ["error", {"defaultAssignment": false}],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"no-unused-expressions": "error",
|
2020-08-20 21:36:11 +02:00
|
|
|
|
"no-use-before-define": ["error", {"functions": false}],
|
2020-10-07 13:17:55 +02:00
|
|
|
|
"no-useless-concat": "error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
"no-useless-constructor": "error",
|
2019-11-02 00:06:25 +01:00
|
|
|
|
"no-var": "error",
|
2020-07-20 22:18:43 +02:00
|
|
|
|
"object-shorthand": "error",
|
2020-07-24 01:26:12 +02:00
|
|
|
|
"one-var": ["error", "never"],
|
2020-07-02 01:45:54 +02:00
|
|
|
|
"prefer-arrow-callback": "error",
|
2020-07-24 01:26:12 +02:00
|
|
|
|
"prefer-const": [
|
|
|
|
|
"error",
|
2017-06-05 09:01:02 +02:00
|
|
|
|
{
|
|
|
|
|
"ignoreReadBeforeAssign": true
|
|
|
|
|
}
|
|
|
|
|
],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"radix": "error",
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"spaced-comment": "off",
|
2020-08-01 03:43:15 +02:00
|
|
|
|
"strict": "error",
|
2020-10-07 12:27:37 +02:00
|
|
|
|
"unicorn/consistent-function-scoping": "off",
|
|
|
|
|
"unicorn/explicit-length-check": "off",
|
|
|
|
|
"unicorn/filename-case": "off",
|
|
|
|
|
"unicorn/no-nested-ternary": "off",
|
|
|
|
|
"unicorn/no-null": "off",
|
|
|
|
|
"unicorn/no-process-exit": "off",
|
|
|
|
|
"unicorn/no-useless-undefined": "off",
|
|
|
|
|
"unicorn/number-literal-case": "off",
|
|
|
|
|
"unicorn/prefer-spread": "off",
|
2020-10-24 10:02:35 +02:00
|
|
|
|
"unicorn/prefer-ternary": "off",
|
2020-10-07 12:27:37 +02:00
|
|
|
|
"unicorn/prevent-abbreviations": "off",
|
2020-07-24 01:26:12 +02:00
|
|
|
|
"valid-typeof": ["error", {"requireStringLiterals": true}],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"yoda": "error"
|
2019-03-24 11:20:43 +01:00
|
|
|
|
},
|
|
|
|
|
"overrides": [
|
2021-02-10 04:53:22 +01:00
|
|
|
|
{
|
|
|
|
|
"files": ["frontend_tests/node_tests/**"],
|
|
|
|
|
"globals": {
|
|
|
|
|
"blueslip": false,
|
|
|
|
|
"current_msg_list": false,
|
|
|
|
|
"home_msg_list": false,
|
|
|
|
|
"i18n": false,
|
2021-02-23 03:54:07 +01:00
|
|
|
|
"location": false
|
2021-02-10 04:53:22 +01:00
|
|
|
|
}
|
|
|
|
|
},
|
2020-02-18 00:08:43 +01:00
|
|
|
|
{
|
2021-02-10 04:51:11 +01:00
|
|
|
|
"files": ["frontend_tests/puppeteer_lib/**", "frontend_tests/puppeteer_tests/**"],
|
|
|
|
|
"globals": {
|
|
|
|
|
"$": false,
|
2021-02-23 03:54:07 +01:00
|
|
|
|
"current_msg_list": false
|
2021-02-10 04:51:11 +01:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
2021-02-10 04:53:22 +01:00
|
|
|
|
"files": ["static/js/**"],
|
2020-02-18 00:08:43 +01:00
|
|
|
|
"globals": {
|
|
|
|
|
"$": false,
|
|
|
|
|
"activity": false,
|
|
|
|
|
"admin": false,
|
|
|
|
|
"alert_words_ui": false,
|
|
|
|
|
"attachments_ui": false,
|
|
|
|
|
"avatar": false,
|
|
|
|
|
"blueslip": false,
|
|
|
|
|
"bot_data": false,
|
|
|
|
|
"buddy_data": false,
|
|
|
|
|
"buddy_list": false,
|
|
|
|
|
"compose_actions": false,
|
|
|
|
|
"compose_ui": false,
|
|
|
|
|
"composebox_typeahead": false,
|
|
|
|
|
"confirm_dialog": false,
|
|
|
|
|
"csrf_token": false,
|
|
|
|
|
"current_msg_list": true,
|
2020-05-12 20:44:05 +02:00
|
|
|
|
"dropdown_list_widget": false,
|
2020-02-18 00:08:43 +01:00
|
|
|
|
"emoji_picker": false,
|
|
|
|
|
"favicon": false,
|
|
|
|
|
"flatpickr": false,
|
|
|
|
|
"hash_util": false,
|
|
|
|
|
"hashchange": false,
|
|
|
|
|
"helpers": false,
|
|
|
|
|
"history": false,
|
|
|
|
|
"home_msg_list": false,
|
|
|
|
|
"hotspots": false,
|
|
|
|
|
"i18n": false,
|
|
|
|
|
"input_pill": false,
|
|
|
|
|
"jQuery": false,
|
|
|
|
|
"localStorage": false,
|
|
|
|
|
"location": false,
|
|
|
|
|
"message_events": false,
|
|
|
|
|
"message_fetch": false,
|
|
|
|
|
"message_flags": false,
|
|
|
|
|
"message_list": false,
|
|
|
|
|
"message_store": false,
|
|
|
|
|
"message_util": false,
|
|
|
|
|
"narrow": false,
|
|
|
|
|
"notifications": false,
|
|
|
|
|
"padded_widget": false,
|
|
|
|
|
"page_params": false,
|
|
|
|
|
"panels": false,
|
|
|
|
|
"pointer": false,
|
|
|
|
|
"presence": false,
|
|
|
|
|
"reactions": false,
|
|
|
|
|
"realm_icon": false,
|
|
|
|
|
"realm_logo": false,
|
|
|
|
|
"realm_night_logo": false,
|
2020-03-21 14:42:10 +01:00
|
|
|
|
"recent_topics": false,
|
2020-02-18 00:08:43 +01:00
|
|
|
|
"reminder": false,
|
|
|
|
|
"search_pill_widget": false,
|
|
|
|
|
"server_events": false,
|
|
|
|
|
"settings": false,
|
|
|
|
|
"settings_account": false,
|
|
|
|
|
"settings_bots": false,
|
|
|
|
|
"settings_display": false,
|
|
|
|
|
"settings_emoji": false,
|
|
|
|
|
"settings_exports": false,
|
|
|
|
|
"settings_linkifiers": false,
|
|
|
|
|
"settings_invites": false,
|
|
|
|
|
"settings_notifications": false,
|
|
|
|
|
"settings_org": false,
|
|
|
|
|
"settings_profile_fields": false,
|
|
|
|
|
"settings_sections": false,
|
|
|
|
|
"settings_streams": false,
|
|
|
|
|
"settings_user_groups": false,
|
|
|
|
|
"settings_users": false,
|
|
|
|
|
"starred_messages": false,
|
|
|
|
|
"stream_list": false,
|
|
|
|
|
"StripeCheckout": false,
|
|
|
|
|
"subs": false,
|
2020-07-08 23:44:01 +02:00
|
|
|
|
"message_view_header": false,
|
2020-02-18 00:08:43 +01:00
|
|
|
|
"timerender": false,
|
|
|
|
|
"typing_events": false,
|
|
|
|
|
"ui": false,
|
|
|
|
|
"ui_init": false,
|
|
|
|
|
"unread": false,
|
|
|
|
|
"unread_ops": false,
|
|
|
|
|
"upload_widget": false,
|
|
|
|
|
"user_events": false,
|
|
|
|
|
"widgetize": false,
|
|
|
|
|
"zxcvbn": false
|
|
|
|
|
}
|
|
|
|
|
},
|
2019-03-24 11:20:43 +01:00
|
|
|
|
{
|
|
|
|
|
"files": ["**/*.ts"],
|
2020-07-24 05:53:38 +02:00
|
|
|
|
"extends": [
|
|
|
|
|
"plugin:@typescript-eslint/recommended",
|
|
|
|
|
"plugin:import/typescript",
|
|
|
|
|
"prettier/@typescript-eslint"
|
|
|
|
|
],
|
2019-03-24 11:20:43 +01:00
|
|
|
|
"parserOptions": {
|
2019-11-04 23:37:32 +01:00
|
|
|
|
"project": "tsconfig.json"
|
2019-03-24 11:20:43 +01:00
|
|
|
|
},
|
|
|
|
|
"rules": {
|
2019-05-31 07:15:00 +02:00
|
|
|
|
// Disable base rule to avoid conflict
|
2019-06-22 08:04:09 +02:00
|
|
|
|
"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/array-type": "error",
|
|
|
|
|
"@typescript-eslint/await-thenable": "error",
|
2019-11-09 02:48:01 +01:00
|
|
|
|
"@typescript-eslint/consistent-type-assertions": "error",
|
2020-07-24 01:26:12 +02:00
|
|
|
|
"@typescript-eslint/explicit-function-return-type": [
|
|
|
|
|
"error",
|
|
|
|
|
{"allowExpressions": true}
|
|
|
|
|
],
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/member-ordering": "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-non-null-assertion": "off",
|
2019-06-22 08:00:15 +02:00
|
|
|
|
"@typescript-eslint/no-parameter-properties": "error",
|
|
|
|
|
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
|
|
|
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
2020-07-24 01:26:12 +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",
|
|
|
|
|
"@typescript-eslint/prefer-includes": "error",
|
|
|
|
|
"@typescript-eslint/prefer-regexp-exec": "error",
|
|
|
|
|
"@typescript-eslint/prefer-string-starts-ends-with": "error",
|
|
|
|
|
"@typescript-eslint/promise-function-async": "error",
|
|
|
|
|
"@typescript-eslint/unified-signatures": "error"
|
2019-03-24 11:20:43 +01:00
|
|
|
|
}
|
2020-07-24 04:33:22 +02:00
|
|
|
|
},
|
2020-08-01 03:43:15 +02:00
|
|
|
|
{
|
|
|
|
|
"files": ["**/*.d.ts"],
|
|
|
|
|
"rules": {
|
|
|
|
|
"import/unambiguous": "off"
|
|
|
|
|
}
|
|
|
|
|
},
|
2020-07-24 04:33:22 +02:00
|
|
|
|
{
|
|
|
|
|
"files": ["frontend_tests/**"],
|
|
|
|
|
"globals": {
|
2021-02-03 23:23:32 +01:00
|
|
|
|
"CSS": false,
|
2020-07-24 04:33:22 +02:00
|
|
|
|
"document": false,
|
2020-12-01 00:57:57 +01:00
|
|
|
|
"navigator": false,
|
2020-12-01 00:02:16 +01:00
|
|
|
|
"window": false
|
2020-07-24 04:33:22 +02:00
|
|
|
|
},
|
|
|
|
|
"rules": {
|
|
|
|
|
"no-sync": "off"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
2020-08-30 13:48:09 +02:00
|
|
|
|
"files": ["tools/debug-require.js"],
|
2020-07-24 04:33:22 +02:00
|
|
|
|
"env": {
|
|
|
|
|
"browser": true,
|
|
|
|
|
"es2020": false
|
|
|
|
|
},
|
|
|
|
|
"rules": {
|
|
|
|
|
// Don’t require ES features that PhantomJS doesn’t support
|
2020-08-31 00:14:06 +02:00
|
|
|
|
// TODO: Toggle these settings now that we don't use PhantomJS
|
2020-07-24 04:33:22 +02:00
|
|
|
|
"no-var": "off",
|
|
|
|
|
"object-shorthand": "off",
|
|
|
|
|
"prefer-arrow-callback": "off"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"files": ["static/**"],
|
|
|
|
|
"env": {
|
|
|
|
|
"browser": true,
|
|
|
|
|
"commonjs": true,
|
|
|
|
|
"node": false
|
|
|
|
|
},
|
|
|
|
|
"rules": {
|
|
|
|
|
"no-console": "error"
|
2020-08-29 04:29:19 +02:00
|
|
|
|
},
|
|
|
|
|
"settings": {
|
|
|
|
|
"import/resolver": "webpack"
|
2020-07-24 04:33:22 +02:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"files": ["static/shared/**"],
|
|
|
|
|
"env": {
|
|
|
|
|
"browser": false,
|
|
|
|
|
"commonjs": false,
|
|
|
|
|
"shared-node-browser": true
|
2020-07-25 21:22:06 +02:00
|
|
|
|
},
|
|
|
|
|
"rules": {
|
|
|
|
|
"import/no-restricted-paths": [
|
|
|
|
|
"error",
|
|
|
|
|
{
|
|
|
|
|
"zones": [
|
|
|
|
|
{
|
|
|
|
|
"target": "./static/shared",
|
|
|
|
|
"from": ".",
|
|
|
|
|
"except": ["./node_modules", "./static/shared"]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
2020-07-24 04:33:22 +02:00
|
|
|
|
}
|
2019-03-24 11:20:43 +01:00
|
|
|
|
}
|
|
|
|
|
]
|
2016-11-04 23:15:18 +01:00
|
|
|
|
}
|