Browse Source

Enable ESLint import recommended rules (#23315)

closed-social-glitch-2
Nick Schonning 1 year ago
committed by GitHub
parent
commit
eddfb33dfe
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 22 additions and 23 deletions
  1. +2
    -1
      .eslintrc.js
  2. +2
    -4
      app/javascript/mastodon/features/audio/index.js
  3. +4
    -1
      app/javascript/mastodon/features/compose/containers/poll_form_container.js
  4. +1
    -2
      app/javascript/mastodon/features/compose/containers/upload_container.js
  5. +1
    -2
      app/javascript/mastodon/features/getting_started/components/announcements.js
  6. +1
    -2
      app/javascript/mastodon/features/notifications/containers/column_settings_container.js
  7. +11
    -11
      app/javascript/mastodon/features/status/index.js

+ 2
- 1
.eslintrc.js View File

@ -5,6 +5,7 @@ module.exports = {
'eslint:recommended',
'plugin:react/recommended',
'plugin:jsx-a11y/recommended',
'plugin:import/recommended',
],
env: {
@ -177,6 +178,7 @@ module.exports = {
},
],
// See https://github.com/import-js/eslint-plugin-import/blob/main/config/recommended.js
'import/extensions': [
'error',
'always',
@ -195,7 +197,6 @@ module.exports = {
],
},
],
'import/no-unresolved': 'error',
'import/no-webpack-loader-syntax': 'error',
'promise/catch-or-return': [

+ 2
- 4
app/javascript/mastodon/features/audio/index.js View File

@ -1,12 +1,10 @@
import React from 'react';
import PropTypes from 'prop-types';
import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
import { formatTime } from 'mastodon/features/video';
import { formatTime, getPointerPosition, fileNameFromURL } from 'mastodon/features/video';
import Icon from 'mastodon/components/icon';
import classNames from 'classnames';
import { throttle } from 'lodash';
import { getPointerPosition, fileNameFromURL } from 'mastodon/features/video';
import { debounce } from 'lodash';
import { throttle, debounce } from 'lodash';
import Visualizer from './visualizer';
import { displayMedia, useBlurhash } from '../../initial_state';
import Blurhash from '../../components/blurhash';

+ 4
- 1
app/javascript/mastodon/features/compose/containers/poll_form_container.js View File

@ -1,7 +1,10 @@
import { connect } from 'react-redux';
import PollForm from '../components/poll_form';
import { addPollOption, removePollOption, changePollOption, changePollSettings } from '../../../actions/compose';
import {
addPollOption,
removePollOption,
changePollOption,
changePollSettings,
clearComposeSuggestions,
fetchComposeSuggestions,
selectComposeSuggestion,

+ 1
- 2
app/javascript/mastodon/features/compose/containers/upload_container.js View File

@ -1,7 +1,6 @@
import { connect } from 'react-redux';
import Upload from '../components/upload';
import { undoUploadCompose, initMediaEditModal } from '../../../actions/compose';
import { submitCompose } from '../../../actions/compose';
import { undoUploadCompose, initMediaEditModal, submitCompose } from '../../../actions/compose';
const mapStateToProps = (state, { id }) => ({
media: state.getIn(['compose', 'media_attachments']).find(item => item.get('id') === id),

+ 1
- 2
app/javascript/mastodon/features/getting_started/components/announcements.js View File

@ -6,9 +6,8 @@ import PropTypes from 'prop-types';
import IconButton from 'mastodon/components/icon_button';
import Icon from 'mastodon/components/icon';
import { defineMessages, injectIntl, FormattedMessage, FormattedDate } from 'react-intl';
import { autoPlayGif, reduceMotion, disableSwiping } from 'mastodon/initial_state';
import { autoPlayGif, reduceMotion, disableSwiping, mascot } from 'mastodon/initial_state';
import elephantUIPlane from 'mastodon/../images/elephant_ui_plane.svg';
import { mascot } from 'mastodon/initial_state';
import unicodeMapping from 'mastodon/features/emoji/emoji_unicode_mapping_light';
import classNames from 'classnames';
import EmojiPickerDropdown from 'mastodon/features/compose/containers/emoji_picker_dropdown_container';

+ 1
- 2
app/javascript/mastodon/features/notifications/containers/column_settings_container.js View File

@ -2,8 +2,7 @@ import { connect } from 'react-redux';
import { defineMessages, injectIntl } from 'react-intl';
import ColumnSettings from '../components/column_settings';
import { changeSetting } from '../../../actions/settings';
import { setFilter } from '../../../actions/notifications';
import { clearNotifications, requestBrowserPermission } from '../../../actions/notifications';
import { setFilter, clearNotifications, requestBrowserPermission } from '../../../actions/notifications';
import { changeAlerts as changePushNotifications } from '../../../actions/push_notifications';
import { openModal } from '../../../actions/modal';
import { showAlert } from '../../../actions/alerts';

+ 11
- 11
app/javascript/mastodon/features/status/index.js View File

@ -5,7 +5,17 @@ import PropTypes from 'prop-types';
import classNames from 'classnames';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { createSelector } from 'reselect';
import { fetchStatus } from '../../actions/statuses';
import {
fetchStatus,
muteStatus,
unmuteStatus,
deleteStatus,
editStatus,
hideStatus,
revealStatus,
translateStatus,
undoStatusTranslation,
} from '../../actions/statuses';
import MissingIndicator from '../../components/missing_indicator';
import LoadingIndicator from 'mastodon/components/loading_indicator';
import DetailedStatus from './components/detailed_status';
@ -26,16 +36,6 @@ import {
mentionCompose,
directCompose,
} from '../../actions/compose';
import {
muteStatus,
unmuteStatus,
deleteStatus,
editStatus,
hideStatus,
revealStatus,
translateStatus,
undoStatusTranslation,
} from '../../actions/statuses';
import {
unblockAccount,
unmuteAccount,

Loading…
Cancel
Save