Merge branch 'eslint-rules' into 'develop'

eslint: add key-spacing and space-unary-ops rules

See merge request soapbox-pub/soapbox-fe!890
features-override
Alex Gleason 2021-11-24 18:10:46 +00:00
commit 665d7a1e1f
9 zmienionych plików z 19 dodań i 8 usunięć

Wyświetl plik

@ -69,6 +69,10 @@ module.exports = {
eqeqeq: 'error',
indent: ['error', 2],
'jsx-quotes': ['error', 'prefer-single'],
'key-spacing': [
'error',
{ mode: 'minimum' },
],
'no-catch-shadow': 'error',
'no-cond-assign': 'error',
'no-console': [
@ -111,6 +115,13 @@ module.exports = {
'prefer-const': 'error',
quotes: ['error', 'single'],
semi: 'error',
'space-unary-ops': [
'error',
{
words: true,
nonwords: false,
},
],
strict: 'off',
'valid-typeof': 'error',

Wyświetl plik

@ -367,7 +367,7 @@ export const fetchAccountLists = accountId => (dispatch, getState) => {
};
export const fetchAccountListsRequest = id => ({
type:LIST_ADDER_LISTS_FETCH_REQUEST,
type: LIST_ADDER_LISTS_FETCH_REQUEST,
id,
});

Wyświetl plik

@ -235,7 +235,7 @@ class Header extends ImmutablePureComponent {
menu.push({
text: intl.formatMessage(messages.direct, { name: account.get('username') }),
action: this.props.onDirect,
icon:require('@tabler/icons/icons/mail.svg'),
icon: require('@tabler/icons/icons/mail.svg'),
});
}

Wyświetl plik

@ -14,7 +14,7 @@ export default class Conversation extends ImmutablePureComponent {
conversationId: PropTypes.string.isRequired,
accounts: ImmutablePropTypes.list.isRequired,
lastStatusId: PropTypes.string,
unread:PropTypes.bool.isRequired,
unread: PropTypes.bool.isRequired,
onMoveUp: PropTypes.func,
onMoveDown: PropTypes.func,
markRead: PropTypes.func.isRequired,

Wyświetl plik

@ -34,7 +34,7 @@ export default @injectIntl class Accordion extends React.PureComponent {
const { headline, children, menu, expanded, intl } = this.props;
return (
<div className={classNames('accordion', { 'accordion--expanded' : expanded })}>
<div className={classNames('accordion', { 'accordion--expanded': expanded })}>
{menu && (
<div className='accordion__menu'>
<DropdownMenu items={menu} icon='ellipsis-v' size={18} direction='right' />

Wyświetl plik

@ -16,7 +16,7 @@ class ColumnsArea extends ImmutablePureComponent {
render() {
const { children } = this.props;
const layout = this.props.layout || { LEFT:null, RIGHT:null };
const layout = this.props.layout || { LEFT: null, RIGHT: null };
return (
<div className='page'>

Wyświetl plik

@ -38,7 +38,7 @@ const MODAL_COMPONENTS = {
'EMBED': EmbedModal,
'LIST_EDITOR': ListEditor,
'FOCAL_POINT': FocalPointModal,
'LIST_ADDER':ListAdder,
'LIST_ADDER': ListAdder,
'HOTKEYS': HotkeysModal,
'COMPOSE': ComposeModal,
'UNAUTHORIZED': UnauthorizedModal,

Wyświetl plik

@ -127,7 +127,7 @@ class ProfileDropdown extends React.PureComponent {
});
return (
<div className='compose__action-bar' style={{ 'marginTop':'-6px' }}>
<div className='compose__action-bar' style={{ marginTop: '-6px' }}>
<div className='compose__action-bar-dropdown'>
<DropdownMenuContainer items={menu} icon='chevron-down' size={size} direction='right' />
</div>

Wyświetl plik

@ -152,7 +152,7 @@ const extractedMessages = extractedMessagesFiles.reduce((acc, messageFile) => {
const translations = languages.map((language) => {
return {
language: language,
data : JSON.parse(fs.readFileSync(path.join(translationsDirectory, language + '.json'), 'utf8')),
data: JSON.parse(fs.readFileSync(path.join(translationsDirectory, language + '.json'), 'utf8')),
};
});