eslint: trailing comma fixes, unused var

patch-2
Alex Gleason 2020-10-07 13:08:36 -05:00
rodzic ed9988b350
commit 0bbdaa4191
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
52 zmienionych plików z 76 dodań i 93 usunięć

Wyświetl plik

@ -111,7 +111,7 @@ export function fetchAccount(id) {
dispatch,
getState,
db.transaction('accounts', 'read').objectStore('accounts').index('id'),
id
id,
).then(() => db.close(), error => {
db.close();
throw error;

Wyświetl plik

@ -29,7 +29,7 @@ export const simpleEmojiReact = (status, emoji) => {
emojiReacts
.filter(emojiReact => emojiReact.get('me') === true)
.map(emojiReact => dispatch(unEmojiReact(status, emojiReact.get('name')))),
status.get('favourited') && dispatch(unfavourite(status))
status.get('favourited') && dispatch(unfavourite(status)),
).then(() => {
if (emoji === '👍') {
dispatch(favourite(status));

Wyświetl plik

@ -15,7 +15,7 @@ describe('<TimelineQueueButtonHeader />', () => {
onClick={() => {}} // eslint-disable-line react/jsx-no-bind
count={0}
message={messages.queue}
/>
/>,
).toJSON()).toMatchSnapshot();
expect(createComponent(
@ -24,7 +24,7 @@ describe('<TimelineQueueButtonHeader />', () => {
onClick={() => {}} // eslint-disable-line react/jsx-no-bind
count={1}
message={messages.queue}
/>
/>,
).toJSON()).toMatchSnapshot();
expect(createComponent(
@ -33,7 +33,7 @@ describe('<TimelineQueueButtonHeader />', () => {
onClick={() => {}} // eslint-disable-line react/jsx-no-bind
count={9999999}
message={messages.queue}
/>
/>,
).toJSON()).toMatchSnapshot();
});
});

Wyświetl plik

@ -130,7 +130,7 @@ class ColumnHeader extends React.PureComponent {
}
>
{list.get('title')}
</Link>)
</Link>),
);
}

Wyświetl plik

@ -44,7 +44,7 @@ export default class IntersectionObserverArticle extends React.Component {
intersectionObserverWrapper.observe(
id,
this.node,
this.handleIntersection
this.handleIntersection,
);
this.componentMounted = true;

Wyświetl plik

@ -323,7 +323,7 @@ class MediaGallery extends React.PureComponent {
let itemsDimensions = [];
const ratios = Array(size).fill().map((_, i) =>
media.getIn([i, 'meta', 'small', 'aspect'])
media.getIn([i, 'meta', 'small', 'aspect']),
);
const [ar1, ar2, ar3, ar4] = ratios;

Wyświetl plik

@ -406,5 +406,5 @@ const mapDispatchToProps = (dispatch) => ({
});
export default injectIntl(
connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true }
connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true },
)(StatusActionBar));

Wyświetl plik

@ -7,7 +7,7 @@ import { Map as ImmutableMap } from 'immutable';
describe('<CaptchaField />', () => {
it('renders null by default', () => {
expect(createComponent(
<CaptchaField />
<CaptchaField />,
).toJSON()).toMatchSnapshot();
});
});
@ -25,7 +25,7 @@ describe('<NativeCaptchaField />', () => {
<NativeCaptchaField
captcha={captcha}
onChange={() => {}} // eslint-disable-line react/jsx-no-bind
/>
/>,
).toJSON()).toMatchSnapshot();
});
});

Wyświetl plik

@ -5,7 +5,7 @@ import { createComponent } from 'soapbox/test_helpers';
describe('<LoginForm />', () => {
it('renders correctly', () => {
expect(createComponent(
<LoginForm />
<LoginForm />,
).toJSON()).toMatchSnapshot();
});
});

Wyświetl plik

@ -13,13 +13,13 @@ describe('<LoginPage />', () => {
it('renders correctly on load', () => {
expect(createComponent(
<LoginPage />
<LoginPage />,
).toJSON()).toMatchSnapshot();
const store = mockStore(ImmutableMap({ me: '1234' }));
expect(createComponent(
<LoginPage />,
{ store }
{ store },
).toJSON()).toMatchSnapshot();
});

Wyświetl plik

@ -12,7 +12,7 @@ describe('<OtpAuthForm />', () => {
<OtpAuthForm
mfa_token={'12345'}
/>,
{ store }
{ store },
).toJSON();
expect(wrapper).toEqual(expect.objectContaining({

Wyświetl plik

@ -28,7 +28,7 @@ class LoginPage extends ImmutablePureComponent {
getFormData = (form) => {
return Object.fromEntries(
Array.from(form).map(i => [i.name, i.value])
Array.from(form).map(i => [i.name, i.value]),
);
}

Wyświetl plik

@ -29,7 +29,7 @@ class OtpAuthForm extends ImmutablePureComponent {
getFormData = (form) => {
return Object.fromEntries(
Array.from(form).map(i => [i.name, i.value])
Array.from(form).map(i => [i.name, i.value]),
);
}

Wyświetl plik

@ -62,7 +62,7 @@ class Blocks extends ImmutablePureComponent {
emptyMessage={emptyMessage}
>
{accountIds.map(id =>
<AccountContainer key={id} id={id} />
<AccountContainer key={id} id={id} />,
)}
</ScrollableList>
</Column>

Wyświetl plik

@ -87,7 +87,7 @@ class ChatMessageList extends ImmutablePureComponent {
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
}
},
);
};

Wyświetl plik

@ -78,7 +78,7 @@ class ChatPanes extends ImmutablePureComponent {
<div className='chat-panes'>
{mainWindowPane}
{panes.map((pane, i) =>
<ChatWindow idx={i} pane={pane} key={pane.get('chat_id')} />
<ChatWindow idx={i} pane={pane} key={pane.get('chat_id')} />,
)}
</div>
);

Wyświetl plik

@ -63,7 +63,7 @@ class Blocks extends ImmutablePureComponent {
emptyMessage={emptyMessage}
>
{domains.map(domain =>
<DomainContainer key={domain} domain={domain} />
<DomainContainer key={domain} domain={domain} />,
)}
</ScrollableList>
</Column>

Wyświetl plik

@ -40,7 +40,7 @@ const mapStateToProps = state => {
// Forces fields to be maxFields size, filling empty values
const normalizeFields = (fields, maxFields) => (
ImmutableList(fields).setSize(maxFields).map(field =>
field ? field : ImmutableMap({ name: '', value: '' })
field ? field : ImmutableMap({ name: '', value: '' }),
)
);
@ -91,7 +91,7 @@ class EditProfile extends ImmutablePureComponent {
this.state.fields.forEach((f, i) =>
params = params
.set(`fields_attributes[${i}][name]`, f.get('name'))
.set(`fields_attributes[${i}][value]`, f.get('value'))
.set(`fields_attributes[${i}][value]`, f.get('value')),
);
return params;
}

Wyświetl plik

@ -56,7 +56,7 @@ class Favourites extends ImmutablePureComponent {
emptyMessage={emptyMessage}
>
{accountIds.map(id =>
<AccountContainer key={id} id={id} withNote={false} />
<AccountContainer key={id} id={id} withNote={false} />,
)}
</ScrollableList>
</Column>

Wyświetl plik

@ -62,7 +62,7 @@ class FollowRequests extends ImmutablePureComponent {
emptyMessage={emptyMessage}
>
{accountIds.map(id =>
<AccountAuthorizeContainer key={id} id={id} />
<AccountAuthorizeContainer key={id} id={id} />,
)}
</ScrollableList>
</Column>

Wyświetl plik

@ -122,7 +122,7 @@ class Followers extends ImmutablePureComponent {
emptyMessage={<FormattedMessage id='account.followers.empty' defaultMessage='No one follows this user yet.' />}
>
{accountIds.map(id =>
<AccountContainer key={id} id={id} withNote={false} />
<AccountContainer key={id} id={id} withNote={false} />,
)}
</ScrollableList>
</Column>

Wyświetl plik

@ -122,7 +122,7 @@ class Following extends ImmutablePureComponent {
emptyMessage={<FormattedMessage id='account.follows.empty' defaultMessage="This user doesn't follow anyone yet." />}
>
{accountIds.map(id =>
<AccountContainer key={id} id={id} withNote={false} />
<AccountContainer key={id} id={id} withNote={false} />,
)}
</ScrollableList>
</Column>

Wyświetl plik

@ -15,7 +15,7 @@ import {
describe('<InputContainer />', () => {
it('renders correctly', () => {
expect(renderer.create(
<InputContainer />
<InputContainer />,
).toJSON()).toMatchSnapshot();
});
});
@ -23,7 +23,7 @@ describe('<InputContainer />', () => {
describe('<SimpleInput />', () => {
it('renders correctly', () => {
expect(renderer.create(
<SimpleInput />
<SimpleInput />,
).toJSON()).toMatchSnapshot();
});
});
@ -31,7 +31,7 @@ describe('<SimpleInput />', () => {
describe('<SimpleForm />', () => {
it('renders correctly', () => {
expect(renderer.create(
<SimpleForm />
<SimpleForm />,
).toJSON()).toMatchSnapshot();
});
});
@ -39,7 +39,7 @@ describe('<SimpleForm />', () => {
describe('<FieldsGroup />', () => {
it('renders correctly', () => {
expect(renderer.create(
<FieldsGroup />
<FieldsGroup />,
).toJSON()).toMatchSnapshot();
});
});
@ -47,7 +47,7 @@ describe('<FieldsGroup />', () => {
describe('<Checkbox />', () => {
it('renders correctly', () => {
expect(renderer.create(
<Checkbox />
<Checkbox />,
).toJSON()).toMatchSnapshot();
});
});
@ -55,7 +55,7 @@ describe('<Checkbox />', () => {
describe('<RadioGroup />', () => {
it('renders correctly', () => {
expect(renderer.create(
<RadioGroup />
<RadioGroup />,
).toJSON()).toMatchSnapshot();
});
});
@ -63,7 +63,7 @@ describe('<RadioGroup />', () => {
describe('<SelectDropdown />', () => {
it('renders correctly', () => {
expect(renderer.create(
<SelectDropdown items={{ one: 'One', two: 'Two', three: 'Three' }} />
<SelectDropdown items={{ one: 'One', two: 'Two', three: 'Three' }} />,
).toJSON()).toMatchSnapshot();
});
});
@ -71,7 +71,7 @@ describe('<SelectDropdown />', () => {
describe('<TextInput />', () => {
it('renders correctly', () => {
expect(renderer.create(
<TextInput />
<TextInput />,
).toJSON()).toMatchSnapshot();
});
});
@ -79,7 +79,7 @@ describe('<TextInput />', () => {
describe('<FileChooser />', () => {
it('renders correctly', () => {
expect(renderer.create(
<FileChooser />
<FileChooser />,
).toJSON()).toMatchSnapshot();
});
});

Wyświetl plik

@ -171,7 +171,7 @@ export class RadioGroup extends ImmutablePureComponent {
const { label, children, onChange } = this.props;
const childrenWithProps = React.Children.map(children, child =>
React.cloneElement(child, { onChange })
React.cloneElement(child, { onChange }),
);
return (

Wyświetl plik

@ -102,7 +102,7 @@ class GettingStarted extends ImmutablePureComponent {
height += 34 + 48*2;
navItems.push(
<ColumnSubheading key={i++} text={intl.formatMessage(messages.personal)} />
<ColumnSubheading key={i++} text={intl.formatMessage(messages.personal)} />,
);
height += 34;
@ -111,7 +111,7 @@ class GettingStarted extends ImmutablePureComponent {
navItems.push(
<ColumnLink key={i++} icon='envelope' text={intl.formatMessage(messages.direct)} to='/timelines/direct' />,
<ColumnLink key={i++} icon='star' text={intl.formatMessage(messages.favourites)} to='/favorites' />,
<ColumnLink key={i++} icon='list-ul' text={intl.formatMessage(messages.lists)} to='/lists' />
<ColumnLink key={i++} icon='list-ul' text={intl.formatMessage(messages.lists)} to='/lists' />,
);
height += 48*3;

Wyświetl plik

@ -71,7 +71,7 @@ class Lists extends ImmutablePureComponent {
emptyMessage={emptyMessage}
>
{lists.map(list =>
<ColumnLink key={list.get('id')} to={`/list/${list.get('id')}`} icon='list-ul' text={list.get('title')} />
<ColumnLink key={list.get('id')} to={`/list/${list.get('id')}`} icon='list-ul' text={list.get('title')} />,
)}
</ScrollableList>
</Column>

Wyświetl plik

@ -62,7 +62,7 @@ class Mutes extends ImmutablePureComponent {
emptyMessage={emptyMessage}
>
{accountIds.map(id =>
<AccountContainer key={id} id={id} />
<AccountContainer key={id} id={id} />,
)}
</ScrollableList>
</Column>

Wyświetl plik

@ -44,7 +44,7 @@ class Header extends ImmutablePureComponent {
getFormData = (form) => {
return Object.fromEntries(
Array.from(form).map(i => [i.name, i.value])
Array.from(form).map(i => [i.name, i.value]),
);
}

Wyświetl plik

@ -77,7 +77,7 @@ class Reblogs extends ImmutablePureComponent {
emptyMessage={emptyMessage}
>
{accountIds.map(id =>
<AccountContainer key={id} id={id} withNote={false} />
<AccountContainer key={id} id={id} withNote={false} />,
)}
</ScrollableList>
</Column>

Wyświetl plik

@ -140,19 +140,19 @@ class SoapboxConfig extends ImmutablePureComponent {
path, (e) =>
template
.merge(field)
.set(key, e.target.value)
.set(key, e.target.value),
);
};
handlePromoItemChange = (index, key, field) => {
return this.handleItemChange(
['promoPanel', 'items', index], key, field, templates.promoPanelItem
['promoPanel', 'items', index], key, field, templates.promoPanelItem,
);
};
handleHomeFooterItemChange = (index, key, field) => {
return this.handleItemChange(
['navlinks', 'homeFooter', index], key, field, templates.footerItem
['navlinks', 'homeFooter', index], key, field, templates.footerItem,
);
};

Wyświetl plik

@ -98,7 +98,7 @@ export default class Card extends React.PureComponent {
},
},
]),
0
0,
);
};

Wyświetl plik

@ -71,5 +71,5 @@ const mapStateToProps = state => {
export default injectIntl(
connect(mapStateToProps, null, null, {
forwardRef: true,
}
},
)(FundingPanel));

Wyświetl plik

@ -150,5 +150,5 @@ const mapStateToProps = (state, { account }) => {
export default injectIntl(
connect(mapStateToProps, null, null, {
forwardRef: true,
}
},
)(ProfileInfoPanel));

Wyświetl plik

@ -81,5 +81,5 @@ const mapStateToProps = (state, { account }) => ({
export default injectIntl(
connect(mapStateToProps, null, null, {
forwardRef: true,
}
},
)(ProfileMediaPanel));

Wyświetl plik

@ -28,7 +28,7 @@ class PromoPanel extends React.PureComponent {
<Icon id={item.get('icon')} className='promo-panel-item__icon' fixedWidth />
{item.get('text')}
</a>
</div>)
</div>),
)}
</div>
</div>

Wyświetl plik

@ -94,7 +94,7 @@ class TabsBar extends React.PureComponent {
<NavLink key='search' className='tabs-bar__link tabs-bar__link--search' to='/search' data-preview-title-id='tabs_bar.search'>
<Icon id='search' />
<span><FormattedMessage id='tabs_bar.search' defaultMessage='Search' /></span>
</NavLink>
</NavLink>,
);
return links.map((link) =>
React.cloneElement(link, {
@ -172,5 +172,5 @@ const mapDispatchToProps = (dispatch) => ({
});
export default injectIntl(
connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true }
connect(mapStateToProps, mapDispatchToProps, null, { forwardRef: true },
)(TabsBar));

Wyświetl plik

@ -66,5 +66,5 @@ const mapDispatchToProps = dispatch => {
export default injectIntl(
connect(mapStateToProps, mapDispatchToProps, null, {
forwardRef: true,
}
},
)(TrendsPanel));

Wyświetl plik

@ -74,5 +74,5 @@ const mapDispatchToProps = dispatch => {
export default injectIntl(
connect(mapStateToProps, mapDispatchToProps, null, {
forwardRef: true,
}
},
)(WhoToFollowPanel));

Wyświetl plik

@ -8,7 +8,7 @@ const defaultBarStyleFactory = (index, style, notification) => {
return Object.assign(
{},
style,
{ bottom: `${14 + index * 12 + index * 42}px` }
{ bottom: `${14 + index * 12 + index * 42}px` },
);
};

Wyświetl plik

@ -109,7 +109,7 @@ const logOut = (state = ImmutableMap()) => {
whitelist.reduce((acc, curr) => {
acc[curr] = state.get(curr);
return acc;
}, {})
}, {}),
);
};

Wyświetl plik

@ -70,7 +70,7 @@ const processRawNotifications = notifications => (
ImmutableOrderedMap(
notifications
.filter(isValid)
.map(n => [n.id, notificationToMap(n)])
.map(n => [n.id, notificationToMap(n)]),
));
const expandNormalizedNotifications = (state, notifications, next) => {

Wyświetl plik

@ -55,13 +55,13 @@ export default function statuses(state = initialState, action) {
return state
.updateIn(
[action.status.get('id'), 'pleroma', 'emoji_reactions'],
emojiReacts => simulateEmojiReact(emojiReacts, action.emoji)
emojiReacts => simulateEmojiReact(emojiReacts, action.emoji),
);
case UNEMOJI_REACT_REQUEST:
return state
.updateIn(
[action.status.get('id'), 'pleroma', 'emoji_reactions'],
emojiReacts => simulateUnEmojiReact(emojiReacts, action.emoji)
emojiReacts => simulateUnEmojiReact(emojiReacts, action.emoji),
);
case FAVOURITE_FAIL:
return state.get(action.status.get('id')) === undefined ? state : state.setIn([action.status.get('id'), 'favourited'], false);

Wyświetl plik

@ -58,7 +58,7 @@ const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, is
return oldIds.take(firstIndex + 1).concat(
isPartial && oldIds.get(firstIndex) !== null ? newIds.unshift(null) : newIds,
oldIds.skip(lastIndex)
oldIds.skip(lastIndex),
);
});
}
@ -149,7 +149,7 @@ const updateTop = (state, timeline, top) => {
const filterTimeline = (timeline, state, relationship, statuses) =>
state.updateIn([timeline, 'items'], ImmutableList(), list =>
list.filterNot(statusId =>
statuses.getIn([statusId, 'account']) === relationship.id
statuses.getIn([statusId, 'account']) === relationship.id,
));
const removeStatusFromGroup = (state, groupId, statusId) => {
@ -190,7 +190,7 @@ export default function timelines(state = initialState, action) {
return state.update(
action.timeline,
initialTimeline,
map => map.set('online', false).update('items', items => items.first() ? items.unshift(null) : items)
map => map.set('online', false).update('items', items => items.first() ? items.unshift(null) : items),
);
case GROUP_REMOVE_STATUS_SUCCESS:
return removeStatusFromGroup(state, action.groupId, action.id);

Wyświetl plik

@ -110,7 +110,7 @@ export const makeGetStatus = () => {
map.set('account', accountBase);
map.set('filtered', filtered);
});
}
},
);
};
@ -172,6 +172,6 @@ export const makeGetChat = () => {
map.set('account', account);
map.set('last_message', lastMessage);
});
}
},
);
};

Wyświetl plik

@ -118,7 +118,7 @@ const handlePush = (event) => {
badge: '/badge.png',
data: { access_token, preferred_locale, url: '/notifications' },
});
})
}),
);
};

Wyświetl plik

@ -10,6 +10,6 @@ export default function configureStore() {
thunk,
loadingBarMiddleware({ promiseTypeSuffixes: ['REQUEST', 'SUCCESS', 'FAIL'] }),
errorsMiddleware(),
soundsMiddleware()
soundsMiddleware(),
), window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f));
};

Wyświetl plik

@ -28,6 +28,6 @@ export const createComponent = (children, props = {}) => {
{children}
</BrowserRouter>
</IntlProvider>
</Provider>
</Provider>,
);
};

Wyświetl plik

@ -1,7 +1,7 @@
export const ConfigDB = {
find: (configs, group, key) => {
return configs.find(config =>
config.isSuperset({ group, key })
config.isSuperset({ group, key }),
);
},
};

Wyświetl plik

@ -39,8 +39,8 @@ export const mergeEmojiFavourites = (emojiReacts, favouritesCount, favourited) =
const hasMultiReactions = (emojiReacts, account) => (
emojiReacts.filter(
e => e.get('accounts').filter(
a => a.get('id') === account.get('id')
).count() > 0
a => a.get('id') === account.get('id'),
).count() > 0,
).count() > 1
);
@ -72,14 +72,14 @@ export const filterEmoji = (emojiReacts, allowedEmoji=ALLOWED_EMOJI) => (
export const reduceEmoji = (emojiReacts, favouritesCount, favourited, allowedEmoji=ALLOWED_EMOJI) => (
filterEmoji(sortEmoji(mergeEmoji(mergeEmojiFavourites(
emojiReacts, favouritesCount, favourited
emojiReacts, favouritesCount, favourited,
))), allowedEmoji));
export const getReactForStatus = status => {
return reduceEmoji(
status.getIn(['pleroma', 'emoji_reactions'], ImmutableList()),
status.get('favourites_count'),
status.get('favourited')
status.get('favourited'),
).filter(e => e.get('me') === true)
.getIn([0, 'name']);
};

Wyświetl plik

@ -89,7 +89,7 @@ module.exports = merge(sharedConfig, {
watchOptions: Object.assign(
{},
settings.dev_server.watch_options,
watchOptions
watchOptions,
),
serveIndex: true,
proxy: makeProxyConfig(),

Wyświetl plik

@ -1,7 +1,6 @@
// Note: You must restart bin/webpack-dev-server for changes to take effect
console.log('Running in production mode'); // eslint-disable-line no-console
const { URL } = require('url');
const merge = require('webpack-merge');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const OfflinePlugin = require('offline-plugin');
@ -10,22 +9,6 @@ const CompressionPlugin = require('compression-webpack-plugin');
const { output } = require('./configuration');
const sharedConfig = require('./shared');
// eslint-disable-next-line no-unused-vars
let attachmentHost;
if (process.env.S3_ENABLED === 'true') {
if (process.env.S3_ALIAS_HOST || process.env.S3_CLOUDFRONT_HOST) {
attachmentHost = process.env.S3_ALIAS_HOST || process.env.S3_CLOUDFRONT_HOST;
} else {
attachmentHost = process.env.S3_HOSTNAME || `s3-${process.env.S3_REGION || 'us-east-1'}.amazonaws.com`;
}
} else if (process.env.SWIFT_ENABLED === 'true') {
const { host } = new URL(process.env.SWIFT_OBJECT_URL);
attachmentHost = host;
} else {
attachmentHost = null;
}
module.exports = merge(sharedConfig, {
mode: 'production',
devtool: 'source-map',

Wyświetl plik

@ -12,7 +12,7 @@ const rules = require('./rules');
module.exports = {
entry: Object.assign(
{ application: resolve('app/application.js') },
{ styles: resolve(join(settings.source_path, 'styles/application.scss')) }
{ styles: resolve(join(settings.source_path, 'styles/application.scss')) },
),
output: {
@ -54,7 +54,7 @@ module.exports = {
// temporary fix for https://github.com/ReactTraining/react-router/issues/5576
// to reduce bundle size
resource.request = resource.request.replace(/^history/, 'history/es');
}
},
),
new MiniCssExtractPlugin({
filename: 'css/[name]-[contenthash:8].css',