Skip to content

Commit

Permalink
Enable eslint:recommended ruleset (mastodon#22433)
Browse files Browse the repository at this point in the history
* Enable ESLint recommended ruleset

* Disable failing ESLint recommended rules

* Remove rules shadowed by eslint:recommended
  • Loading branch information
nschonni authored Dec 18, 2022
1 parent 2889c68 commit 06b6849
Show file tree
Hide file tree
Showing 74 changed files with 350 additions and 348 deletions.
16 changes: 9 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
module.exports = {
root: true,

extends: [
'eslint:recommended',
],

env: {
browser: true,
node: true,
Expand Down Expand Up @@ -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',
{
Expand All @@ -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',
Expand All @@ -96,6 +98,7 @@ module.exports = {
ignoreRestSiblings: true,
},
],
'no-useless-escape': 'off',
'object-curly-spacing': ['error', 'always'],
'padded-blocks': [
'error',
Expand All @@ -105,7 +108,6 @@ module.exports = {
],
quotes: ['error', 'single'],
semi: 'error',
strict: 'off',
'valid-typeof': 'error',

'react/jsx-boolean-value': 'error',
Expand Down
8 changes: 4 additions & 4 deletions app/javascript/mastodon/actions/account_notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
};
}
Loading

0 comments on commit 06b6849

Please sign in to comment.