Browse Source

Enable ESLint no-useless-escape (#23311)

closed-social-glitch-2
Nick Schonning 1 year ago
committed by GitHub
parent
commit
db2c58d47a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 11 additions and 12 deletions
  1. +0
    -1
      .eslintrc.js
  2. +1
    -1
      app/javascript/mastodon/actions/push_notifications/registerer.js
  3. +1
    -1
      app/javascript/mastodon/components/status.js
  4. +1
    -1
      app/javascript/mastodon/features/account_gallery/components/media_item.js
  5. +1
    -1
      app/javascript/mastodon/features/compose/containers/warning_container.js
  6. +1
    -1
      app/javascript/mastodon/features/compose/util/counter.js
  7. +1
    -1
      app/javascript/mastodon/features/emoji/emoji_utils.js
  8. +1
    -1
      app/javascript/mastodon/features/follow_recommendations/components/account.js
  9. +1
    -1
      app/javascript/mastodon/features/picture_in_picture/components/footer.js
  10. +1
    -1
      app/javascript/mastodon/features/status/components/detailed_status.js
  11. +1
    -1
      app/javascript/mastodon/features/ui/components/boost_modal.js
  12. +1
    -1
      config/webpack/shared.js

+ 0
- 1
.eslintrc.js View File

@ -98,7 +98,6 @@ module.exports = {
ignoreRestSiblings: true,
},
],
'no-useless-escape': 'off',
'object-curly-spacing': ['error', 'always'],
'padded-blocks': [
'error',

+ 1
- 1
app/javascript/mastodon/actions/push_notifications/registerer.js View File

@ -8,7 +8,7 @@ import { me } from '../../initial_state';
const urlBase64ToUint8Array = (base64String) => {
const padding = '='.repeat((4 - base64String.length % 4) % 4);
const base64 = (base64String + padding)
.replace(/\-/g, '+')
.replace(/-/g, '+')
.replace(/_/g, '/');
return decodeBase64(base64);

+ 1
- 1
app/javascript/mastodon/components/status.js View File

@ -511,7 +511,7 @@ class Status extends ImmutablePureComponent {
<div className={classNames('status', `status-${status.get('visibility')}`, { 'status-reply': !!status.get('in_reply_to_id'), muted: this.props.muted })} data-id={status.get('id')}>
<div className='status__info'>
<a onClick={this.handleClick} href={`/@${status.getIn(['account', 'acct'])}\/${status.get('id')}`} className='status__relative-time' target='_blank' rel='noopener noreferrer'>
<a onClick={this.handleClick} href={`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`} className='status__relative-time' target='_blank' rel='noopener noreferrer'>
<span className='status__visibility-icon'><Icon id={visibilityIcon.icon} title={visibilityIcon.text} /></span>
<RelativeTimestamp timestamp={status.get('created_at')} />{status.get('edited_at') && <abbr title={intl.formatMessage(messages.edited, { date: intl.formatDate(status.get('edited_at'), { hour12: false, year: 'numeric', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }) })}> *</abbr>}
</a>

+ 1
- 1
app/javascript/mastodon/features/account_gallery/components/media_item.js View File

@ -130,7 +130,7 @@ export default class MediaItem extends ImmutablePureComponent {
return (
<div className='account-gallery__item' style={{ width, height }}>
<a className='media-gallery__item-thumbnail' href={`/@${status.getIn(['account', 'acct'])}\/${status.get('id')}`} onClick={this.handleClick} title={title} target='_blank' rel='noopener noreferrer'>
<a className='media-gallery__item-thumbnail' href={`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`} onClick={this.handleClick} title={title} target='_blank' rel='noopener noreferrer'>
<Blurhash
hash={attachment.get('blurhash')}
className={classNames('media-gallery__preview', { 'media-gallery__preview--hidden': visible && loaded })}

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

@ -24,7 +24,7 @@ const buildHashtagRE = () => {
'))', 'iu',
);
} catch {
return /(?:^|[^\/\)\w])#(\w*[a-zA-Z·]\w*)/i;
return /(?:^|[^/)\w])#(\w*[a-zA-Z·]\w*)/i;
}
};

+ 1
- 1
app/javascript/mastodon/features/compose/util/counter.js View File

@ -5,5 +5,5 @@ const urlPlaceholder = '$2xxxxxxxxxxxxxxxxxxxxxxx';
export function countableText(inputText) {
return inputText
.replace(urlRegex, urlPlaceholder)
.replace(/(^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/ig, '$1@$3');
.replace(/(^|[^/\w])@(([a-z0-9_]+)@[a-z0-9.-]+[a-z0-9]+)/ig, '$1@$3');
}

+ 1
- 1
app/javascript/mastodon/features/emoji/emoji_utils.js View File

@ -73,7 +73,7 @@ const stringFromCodePoint = _String.fromCodePoint || function () {
const _JSON = JSON;
const COLONS_REGEX = /^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/;
const COLONS_REGEX = /^(?::([^:]+):)(?::skin-tone-(\d):)?$/;
const SKINS = [
'1F3FA', '1F3FB', '1F3FC',
'1F3FD', '1F3FE', '1F3FF',

+ 1
- 1
app/javascript/mastodon/features/follow_recommendations/components/account.js View File

@ -27,7 +27,7 @@ const makeMapStateToProps = () => {
};
const getFirstSentence = str => {
const arr = str.split(/(([\.\?!]+\s)|[.。?!\n•])/);
const arr = str.split(/(([.?!]+\s)|[.。?!\n•])/);
return arr[0];
};

+ 1
- 1
app/javascript/mastodon/features/picture_in_picture/components/footer.js View File

@ -184,7 +184,7 @@ class Footer extends ImmutablePureComponent {
<IconButton className='status__action-bar-button' title={replyTitle} icon={status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) ? 'reply' : replyIcon} onClick={this.handleReplyClick} counter={status.get('replies_count')} obfuscateCount />
<IconButton className={classNames('status__action-bar-button', { reblogPrivate })} disabled={!publicStatus && !reblogPrivate} active={status.get('reblogged')} title={reblogTitle} icon='retweet' onClick={this.handleReblogClick} counter={status.get('reblogs_count')} />
<IconButton className='status__action-bar-button star-icon' animate active={status.get('favourited')} title={intl.formatMessage(messages.favourite)} icon='star' onClick={this.handleFavouriteClick} counter={status.get('favourites_count')} />
{withOpenButton && <IconButton className='status__action-bar-button' title={intl.formatMessage(messages.open)} icon='external-link' onClick={this.handleOpenClick} href={`/@${status.getIn(['account', 'acct'])}\/${status.get('id')}`} />}
{withOpenButton && <IconButton className='status__action-bar-button' title={intl.formatMessage(messages.open)} icon='external-link' onClick={this.handleOpenClick} href={`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`} />}
</div>
);
}

+ 1
- 1
app/javascript/mastodon/features/status/components/detailed_status.js View File

@ -276,7 +276,7 @@ class DetailedStatus extends ImmutablePureComponent {
{media}
<div className='detailed-status__meta'>
<a className='detailed-status__datetime' href={`/@${status.getIn(['account', 'acct'])}\/${status.get('id')}`} target='_blank' rel='noopener noreferrer'>
<a className='detailed-status__datetime' href={`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`} target='_blank' rel='noopener noreferrer'>
<FormattedDate value={new Date(status.get('created_at'))} hour12={false} year='numeric' month='short' day='2-digit' hour='2-digit' minute='2-digit' />
</a>{edited}{visibilityLink}{applicationLink}{reblogLink} · {favouriteLink}
</div>

+ 1
- 1
app/javascript/mastodon/features/ui/components/boost_modal.js View File

@ -98,7 +98,7 @@ class BoostModal extends ImmutablePureComponent {
<div className='boost-modal__container'>
<div className={classNames('status', `status-${status.get('visibility')}`, 'light')}>
<div className='status__info'>
<a href={`/@${status.getIn(['account', 'acct'])}\/${status.get('id')}`} className='status__relative-time' target='_blank' rel='noopener noreferrer'>
<a href={`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`} className='status__relative-time' target='_blank' rel='noopener noreferrer'>
<span className='status__visibility-icon'><Icon id={visibilityIcon.icon} title={visibilityIcon.text} /></span>
<RelativeTimestamp timestamp={status.get('created_at')} />
</a>

+ 1
- 1
config/webpack/shared.js View File

@ -55,7 +55,7 @@ module.exports = {
chunks: 'all',
minChunks: 2,
minSize: 0,
test: /^(?!.*[\\\/]node_modules[\\\/]react-intl[\\\/]).+$/,
test: /^(?!.*[\\/]node_modules[\\/]react-intl[\\/]).+$/,
},
},
},

Loading…
Cancel
Save