diff options
author | Nick Schonning <nschonni@gmail.com> | 2022-12-18 10:51:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-19 00:51:37 +0900 |
commit | 06b68490d1957d680adc0c0c4ed2c84641de2056 (patch) | |
tree | 95127495c9e773fc71a38f3df2a833bfc6d03d09 | |
parent | 2889c686108e89a87317505f93b841f5a8a6649b (diff) |
Enable eslint:recommended ruleset (#22433)
* Enable ESLint recommended ruleset
* Disable failing ESLint recommended rules
* Remove rules shadowed by eslint:recommended
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, |