diff --git a/.eslintrc.yml b/.eslintrc.yml index 049d4ecf3443baa0198ab4e90d903257dfe483db..2fb54ae66912146333500ed063922d7b13c0a2ff 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -43,7 +43,10 @@ rules: - prefer-single no-catch-shadow: error no-cond-assign: error - no-console: warn + no-console: + - warn + - allow: + - error no-fallthrough: error no-irregular-whitespace: error no-mixed-spaces-and-tabs: warn diff --git a/app/javascript/mastodon/features/notifications/components/notification.js b/app/javascript/mastodon/features/notifications/components/notification.js index 9afdf6f4c377c429e50c5ffbf4763ade532fec50..6ec4d5dc67191341f129a0f58ba961bca2b29330 100644 --- a/app/javascript/mastodon/features/notifications/components/notification.js +++ b/app/javascript/mastodon/features/notifications/components/notification.js @@ -65,11 +65,11 @@ class Notification extends ImmutablePureComponent { ); } - render () { // eslint-disable-line consistent-return + render () { const { notification } = this.props; const account = notification.get('account'); const displayName = account.get('display_name').length > 0 ? account.get('display_name') : account.get('username'); - const displayNameHTML = { __html: emojify(escapeTextContentForBrowser(displayName)) }; + const displayNameHTML = { __html: emojify(escapeTextContentForBrowser(displayName)) }; const link = <Permalink className='notification__display-name' href={account.get('url')} title={account.get('acct')} to={`/accounts/${account.get('id')}`} dangerouslySetInnerHTML={displayNameHTML} />; switch(notification.get('type')) { @@ -82,6 +82,8 @@ class Notification extends ImmutablePureComponent { case 'reblog': return this.renderReblog(notification, link); } + + return null; } } diff --git a/app/javascript/mastodon/middleware/errors.js b/app/javascript/mastodon/middleware/errors.js index 9a51257cb840b7a065b6087fa59c6dd75d965e69..4aca75f1e363dd2e13099649d3e09fc153b9fc31 100644 --- a/app/javascript/mastodon/middleware/errors.js +++ b/app/javascript/mastodon/middleware/errors.js @@ -22,7 +22,7 @@ export default function errorsMiddleware() { dispatch(showAlert(title, message)); } else { - console.error(action.error); // eslint-disable-line no-console + console.error(action.error); dispatch(showAlert('Oops!', 'An unexpected error occurred.')); } } diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 8932dc5138d1e5b85a2fff54e90937616d4eeefe..63c5d62720f25d916c02b95811f2d6661e9c0e71 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -2,5 +2,5 @@ import main from '../mastodon/main'; import loadPolyfills from '../mastodon/load_polyfills'; loadPolyfills().then(main).catch(e => { - console.error(e); // eslint-disable-line no-console + console.error(e); }); diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js index 4c0a3d69395bbe58a27ba0442cc634b9827166e5..a0e511b0a3f42ce8e715802a12a2d9f4f8a00d7c 100644 --- a/app/javascript/packs/public.js +++ b/app/javascript/packs/public.js @@ -93,5 +93,5 @@ function main() { } loadPolyfills().then(main).catch(error => { - console.log(error); // eslint-disable-line no-console + console.error(error); }); diff --git a/config/webpack/production.js b/config/webpack/production.js index c93dd55e3095c3960e58c4efcb6c2c262f72255f..755464061422094bcd1e97fd8ac4da35dee82c7b 100644 --- a/config/webpack/production.js +++ b/config/webpack/production.js @@ -1,7 +1,5 @@ // Note: You must restart bin/webpack-dev-server for changes to take effect -/* eslint global-require: 0 */ - const webpack = require('webpack'); const merge = require('webpack-merge'); const CompressionPlugin = require('compression-webpack-plugin'); diff --git a/config/webpack/shared.js b/config/webpack/shared.js index 0f767fb473b677a2974239b1ad26e899e1ef3be1..8fd80a00d5c41f906e78a6c14e46ad5dd80768b7 100644 --- a/config/webpack/shared.js +++ b/config/webpack/shared.js @@ -1,8 +1,5 @@ // Note: You must restart bin/webpack-dev-server for changes to take effect -/* eslint global-require: 0 */ -/* eslint import/no-dynamic-require: 0 */ - const { existsSync } = require('fs'); const webpack = require('webpack'); const { basename, dirname, join, relative, resolve, sep } = require('path'); diff --git a/config/webpack/translationRunner.js b/config/webpack/translationRunner.js index 79bb6980f5a0c17437e93114501718ccec4ff9f8..097099b48cb1ae3f278cc4f1b24237d4ec1ec92f 100644 --- a/config/webpack/translationRunner.js +++ b/config/webpack/translationRunner.js @@ -38,7 +38,6 @@ const validateLanguages = (languages, validators) => { }, []); if (invalidLanguages.length > 0) { - // eslint-disable-next-line no-console console.error(` Error: Specified invalid LANGUAGES: ${invalidLanguages.map(({ language, error }) => `* ${language}: ${error.message}`).join('\n')} @@ -73,7 +72,6 @@ ${availableLanguages.join(', ')} // check if message directory exists if (!fs.existsSync(messagesDirectory)) { - // eslint-disable-next-line no-console console.error(` Error: messagesDirectory not exists (${messagesDirectory})