summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Schonning <nschonni@gmail.com>2022-12-18 10:51:37 -0500
committerGitHub <noreply@github.com>2022-12-19 00:51:37 +0900
commit06b68490d1957d680adc0c0c4ed2c84641de2056 (patch)
tree95127495c9e773fc71a38f3df2a833bfc6d03d09
parent2889c686108e89a87317505f93b841f5a8a6649b (diff)
Enable eslint:recommended ruleset (#22433)
* Enable ESLint recommended ruleset * Disable failing ESLint recommended rules * Remove rules shadowed by eslint:recommended
-rw-r--r--.eslintrc.js16
-rw-r--r--app/javascript/mastodon/actions/account_notes.js8
-rw-r--r--app/javascript/mastodon/actions/accounts.js144
-rw-r--r--app/javascript/mastodon/actions/alerts.js6
-rw-r--r--app/javascript/mastodon/actions/blocks.js16
-rw-r--r--app/javascript/mastodon/actions/bookmarks.js16
-rw-r--r--app/javascript/mastodon/actions/columns.js6
-rw-r--r--app/javascript/mastodon/actions/compose.js88
-rw-r--r--app/javascript/mastodon/actions/custom_emojis.js8
-rw-r--r--app/javascript/mastodon/actions/domain_blocks.js32
-rw-r--r--app/javascript/mastodon/actions/emojis.js2
-rw-r--r--app/javascript/mastodon/actions/favourites.js16
-rw-r--r--app/javascript/mastodon/actions/height_cache.js4
-rw-r--r--app/javascript/mastodon/actions/interactions.js80
-rw-r--r--app/javascript/mastodon/actions/markers.js10
-rw-r--r--app/javascript/mastodon/actions/modal.js4
-rw-r--r--app/javascript/mastodon/actions/mutes.js16
-rw-r--r--app/javascript/mastodon/actions/notifications.js18
-rw-r--r--app/javascript/mastodon/actions/pin_statuses.js8
-rw-r--r--app/javascript/mastodon/actions/search.js12
-rw-r--r--app/javascript/mastodon/actions/settings.js4
-rw-r--r--app/javascript/mastodon/actions/statuses.js48
-rw-r--r--app/javascript/mastodon/actions/store.js2
-rw-r--r--app/javascript/mastodon/actions/suggestions.js8
-rw-r--r--app/javascript/mastodon/actions/timelines.js18
-rw-r--r--app/javascript/mastodon/common.js2
-rw-r--r--app/javascript/mastodon/compare_id.js2
-rw-r--r--app/javascript/mastodon/components/admin/Retention.js2
-rw-r--r--app/javascript/mastodon/features/closed_registrations_modal/index.js2
-rw-r--r--app/javascript/mastodon/features/compose/util/counter.js2
-rw-r--r--app/javascript/mastodon/features/hashtag_timeline/components/column_settings.js4
-rw-r--r--app/javascript/mastodon/features/list_timeline/index.js2
-rw-r--r--app/javascript/mastodon/features/ui/components/disabled_account_banner.js2
-rw-r--r--app/javascript/mastodon/features/ui/components/link_footer.js2
-rw-r--r--app/javascript/mastodon/features/ui/util/react_router_helpers.js2
-rw-r--r--app/javascript/mastodon/middleware/errors.js2
-rw-r--r--app/javascript/mastodon/middleware/loading_bar.js2
-rw-r--r--app/javascript/mastodon/middleware/sounds.js2
-rw-r--r--app/javascript/mastodon/reducers/accounts.js2
-rw-r--r--app/javascript/mastodon/reducers/accounts_counters.js2
-rw-r--r--app/javascript/mastodon/reducers/accounts_map.js2
-rw-r--r--app/javascript/mastodon/reducers/alerts.js2
-rw-r--r--app/javascript/mastodon/reducers/announcements.js2
-rw-r--r--app/javascript/mastodon/reducers/compose.js10
-rw-r--r--app/javascript/mastodon/reducers/contexts.js2
-rw-r--r--app/javascript/mastodon/reducers/conversations.js2
-rw-r--r--app/javascript/mastodon/reducers/custom_emojis.js2
-rw-r--r--app/javascript/mastodon/reducers/domain_lists.js2
-rw-r--r--app/javascript/mastodon/reducers/filters.js2
-rw-r--r--app/javascript/mastodon/reducers/height_cache.js2
-rw-r--r--app/javascript/mastodon/reducers/list_adder.js2
-rw-r--r--app/javascript/mastodon/reducers/list_editor.js2
-rw-r--r--app/javascript/mastodon/reducers/lists.js2
-rw-r--r--app/javascript/mastodon/reducers/markers.js2
-rw-r--r--app/javascript/mastodon/reducers/media_attachments.js2
-rw-r--r--app/javascript/mastodon/reducers/meta.js2
-rw-r--r--app/javascript/mastodon/reducers/missed_updates.js2
-rw-r--r--app/javascript/mastodon/reducers/modal.js2
-rw-r--r--app/javascript/mastodon/reducers/notifications.js2
-rw-r--r--app/javascript/mastodon/reducers/picture_in_picture.js2
-rw-r--r--app/javascript/mastodon/reducers/push_notifications.js2
-rw-r--r--app/javascript/mastodon/reducers/relationships.js2
-rw-r--r--app/javascript/mastodon/reducers/search.js2
-rw-r--r--app/javascript/mastodon/reducers/settings.js2
-rw-r--r--app/javascript/mastodon/reducers/status_lists.js2
-rw-r--r--app/javascript/mastodon/reducers/statuses.js2
-rw-r--r--app/javascript/mastodon/reducers/suggestions.js2
-rw-r--r--app/javascript/mastodon/reducers/tags.js2
-rw-r--r--app/javascript/mastodon/reducers/timelines.js2
-rw-r--r--app/javascript/mastodon/reducers/trends.js2
-rw-r--r--app/javascript/mastodon/reducers/user_lists.js2
-rw-r--r--app/javascript/mastodon/store/configureStore.js2
-rw-r--r--app/javascript/mastodon/uuid.js2
-rw-r--r--streaming/index.js2
74 files changed, 350 insertions, 348 deletions
diff --git a/.eslintrc.js b/.eslintrc.js
index e4ada6fe0d1..03af2975b83 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,6 +1,10 @@
module.exports = {
root: true,
+ extends: [
+ 'eslint:recommended',
+ ],
+
env: {
browser: true,
node: true,
@@ -64,8 +68,8 @@ module.exports = {
eqeqeq: 'error',
indent: ['warn', 2],
'jsx-quotes': ['error', 'prefer-single'],
+ 'no-case-declarations': 'off',
'no-catch-shadow': 'error',
- 'no-cond-assign': 'error',
'no-console': [
'warn',
{
@@ -75,18 +79,16 @@ module.exports = {
],
},
],
- 'no-fallthrough': 'error',
- 'no-irregular-whitespace': 'error',
- 'no-mixed-spaces-and-tabs': 'warn',
+ 'no-empty': 'off',
'no-nested-ternary': 'warn',
+ 'no-prototype-builtins': 'off',
'no-restricted-properties': [
'error',
{ property: 'substring', message: 'Use .slice instead of .substring.' },
{ property: 'substr', message: 'Use .slice instead of .substr.' },
],
+ 'no-self-assign': 'off',
'no-trailing-spaces': 'warn',
- 'no-undef': 'error',
- 'no-unreachable': 'error',
'no-unused-expressions': 'error',
'no-unused-vars': [
'error',
@@ -96,6 +98,7 @@ module.exports = {
ignoreRestSiblings: true,
},
],
+ 'no-useless-escape': 'off',
'object-curly-spacing': ['error', 'always'],
'padded-blocks': [
'error',
@@ -105,7 +108,6 @@ module.exports = {
],
quotes: ['error', 'single'],
semi: 'error',
- strict: 'off',
'valid-typeof': 'error',
'react/jsx-boolean-value': 'error',
diff --git a/app/javascript/mastodon/actions/account_notes.js b/app/javascript/mastodon/actions/account_notes.js
index d1744100025..72b943300d8 100644
--- a/app/javascript/mastodon/actions/account_notes.js
+++ b/app/javascript/mastodon/actions/account_notes.js
@@ -14,24 +14,24 @@ export function submitAccountNote(id, value) {
dispatch(submitAccountNoteSuccess(response.data));
}).catch(error => dispatch(submitAccountNoteFail(error)));
};
-};
+}
export function submitAccountNoteRequest() {
return {
type: ACCOUNT_NOTE_SUBMIT_REQUEST,
};
-};
+}
export function submitAccountNoteSuccess(relationship) {
return {
type: ACCOUNT_NOTE_SUBMIT_SUCCESS,
relationship,
};
-};
+}
export function submitAccountNoteFail(error) {
return {
type: ACCOUNT_NOTE_SUBMIT_FAIL,
error,
};
-};
+}
diff --git a/app/javascript/mastodon/actions/accounts.js b/app/javascript/mastodon/actions/accounts.js
index f61f06e408f..88407ae6cf3 100644
--- a/app/javascript/mastodon/actions/accounts.js
+++ b/app/javascript/mastodon/actions/accounts.js
@@ -91,7 +91,7 @@ export function fetchAccount(id) {
dispatch(fetchAccountFail(id, error));
});
};
-};
+}
export const lookupAccount = acct => (dispatch, getState) => {
dispatch(lookupAccountRequest(acct));
@@ -126,13 +126,13 @@ export function fetchAccountRequest(id) {
type: ACCOUNT_FETCH_REQUEST,
id,
};
-};
+}
export function fetchAccountSuccess() {
return {
type: ACCOUNT_FETCH_SUCCESS,
};
-};
+}
export function fetchAccountFail(id, error) {
return {
@@ -141,7 +141,7 @@ export function fetchAccountFail(id, error) {
error,
skipAlert: true,
};
-};
+}
export function followAccount(id, options = { reblogs: true }) {
return (dispatch, getState) => {
@@ -156,7 +156,7 @@ export function followAccount(id, options = { reblogs: true }) {
dispatch(followAccountFail(error, locked));
});
};
-};
+}
export function unfollowAccount(id) {
return (dispatch, getState) => {
@@ -168,7 +168,7 @@ export function unfollowAccount(id) {
dispatch(unfollowAccountFail(error));
});
};
-};
+}
export function followAccountRequest(id, locked) {
return {
@@ -177,7 +177,7 @@ export function followAccountRequest(id, locked) {
locked,
skipLoading: true,
};
-};
+}
export function followAccountSuccess(relationship, alreadyFollowing) {
return {
@@ -186,7 +186,7 @@ export function followAccountSuccess(relationship, alreadyFollowing) {
alreadyFollowing,
skipLoading: true,
};
-};
+}
export function followAccountFail(error, locked) {
return {
@@ -195,7 +195,7 @@ export function followAccountFail(error, locked) {
locked,
skipLoading: true,
};
-};
+}
export function unfollowAccountRequest(id) {
return {
@@ -203,7 +203,7 @@ export function unfollowAccountRequest(id) {
id,
skipLoading: true,
};
-};
+}
export function unfollowAccountSuccess(relationship, statuses) {
return {
@@ -212,7 +212,7 @@ export function unfollowAccountSuccess(relationship, statuses) {
statuses,
skipLoading: true,
};
-};
+}
export function unfollowAccountFail(error) {
return {
@@ -220,7 +220,7 @@ export function unfollowAccountFail(error) {
error,
skipLoading: true,
};
-};
+}
export function blockAccount(id) {
return (dispatch, getState) => {
@@ -233,7 +233,7 @@ export function blockAccount(id) {
dispatch(blockAccountFail(id, error));
});
};
-};
+}
export function unblockAccount(id) {
return (dispatch, getState) => {
@@ -245,14 +245,14 @@ export function unblockAccount(id) {
dispatch(unblockAccountFail(id, error));
});
};
-};
+}
export function blockAccountRequest(id) {
return {
type: ACCOUNT_BLOCK_REQUEST,
id,
};
-};
+}
export function blockAccountSuccess(relationship, statuses) {
return {
@@ -260,35 +260,35 @@ export function blockAccountSuccess(relationship, statuses) {
relationship,
statuses,
};
-};
+}
export function blockAccountFail(error) {
return {
type: ACCOUNT_BLOCK_FAIL,
error,
};
-};
+}
export function unblockAccountRequest(id) {
return {
type: ACCOUNT_UNBLOCK_REQUEST,
id,
};
-};
+}
export function unblockAccountSuccess(relationship) {
return {
type: ACCOUNT_UNBLOCK_SUCCESS,
relationship,
};
-};
+}
export function unblockAccountFail(error) {
return {
type: ACCOUNT_UNBLOCK_FAIL,
error,
};
-};
+}
export function muteAccount(id, notifications, duration=0) {
@@ -302,7 +302,7 @@ export function muteAccount(id, notifications, duration=0) {
dispatch(muteAccountFail(id, error));
});
};
-};
+}
export function unmuteAccount(id) {
return (dispatch,