update eslint's comma-dangle rule to always-multiline (#1457)

* update eslint's `comma-dangle` rule to `always-multiline`

* add check and fix scripts to package.json

* Invoke `yarn fix` to adopt the updated eslint rules. No other changes are included.
This commit is contained in:
Jesse Hallam
2018-02-23 09:06:02 -05:00
committed by Harrison Healey
parent 4b3bc57643
commit 58b72302d6
411 changed files with 3944 additions and 3942 deletions

View File

@@ -9,7 +9,7 @@ import {
StyleSheet,
Text,
TouchableOpacity,
View
View,
} from 'react-native';
import CustomPropTypes from 'app/constants/custom_prop_types';
@@ -29,11 +29,11 @@ class MarkdownCodeBlock extends React.PureComponent {
language: PropTypes.string,
content: PropTypes.string.isRequired,
textStyle: CustomPropTypes.Style,
onLongPress: PropTypes.func.isRequired
onLongPress: PropTypes.func.isRequired,
};
static defaultProps = {
language: ''
language: '',
};
handlePress = wrapWithPreventDoubleTap(() => {
@@ -45,16 +45,16 @@ class MarkdownCodeBlock extends React.PureComponent {
title = intl.formatMessage(
{
id: 'mobile.routes.code',
defaultMessage: '{language} Code'
defaultMessage: '{language} Code',
},
{
language: languageDisplayName
language: languageDisplayName,
}
);
} else {
title = intl.formatMessage({
id: 'mobile.routes.code.noLanguage',
defaultMessage: 'Code'
defaultMessage: 'Code',
});
}
@@ -64,14 +64,14 @@ class MarkdownCodeBlock extends React.PureComponent {
animated: true,
backButtonTitle: '',
passProps: {
content: this.props.content
content: this.props.content,
},
navigatorStyle: {
navBarTextColor: theme.sidebarHeaderTextColor,
navBarBackgroundColor: theme.sidebarHeaderBg,
navBarButtonColor: theme.sidebarHeaderTextColor,
screenBackgroundColor: theme.centerChannelBg
}
screenBackgroundColor: theme.centerChannelBg,
},
});
});
@@ -84,7 +84,7 @@ class MarkdownCodeBlock extends React.PureComponent {
if (config.copyAndPasteProtection !== 'true') {
action = {
text: formatMessage({id: 'mobile.markdown.code.copy_code', defaultMessage: 'Copy Code'}),
onPress: this.handleCopyCode
onPress: this.handleCopyCode,
};
}
@@ -102,13 +102,13 @@ class MarkdownCodeBlock extends React.PureComponent {
if (numberOfLines > MAX_LINES) {
return {
content: lines.slice(0, MAX_LINES).join('\n'),
numberOfLines
numberOfLines,
};
}
return {
content,
numberOfLines
numberOfLines,
};
};
@@ -147,7 +147,7 @@ class MarkdownCodeBlock extends React.PureComponent {
id='mobile.markdown.code.plusMoreLines'
defaultMessage='+{count, number} more {count, plural, one {line} other {lines}}'
values={{
count: numberOfLines - MAX_LINES
count: numberOfLines - MAX_LINES,
}}
/>
);
@@ -185,7 +185,7 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
borderColor: changeOpacity(theme.centerChannelColor, 0.15),
borderRadius: 3,
borderWidth: StyleSheet.hairlineWidth,
flexDirection: 'row'
flexDirection: 'row',
},
lineNumbers: {
alignItems: 'center',
@@ -195,32 +195,32 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
flexDirection: 'column',
justifyContent: 'flex-start',
paddingVertical: 4,
width: 21
width: 21,
},
lineNumbersText: {
color: changeOpacity(theme.centerChannelColor, 0.5),
fontSize: 12,
lineHeight: 18
lineHeight: 18,
},
rightColumn: {
flexDirection: 'column',
flex: 1,
paddingHorizontal: 6,
paddingVertical: 4
paddingVertical: 4,
},
code: {
flexDirection: 'row',
overflow: 'scroll' // Doesn't actually cause a scrollbar, but stops text from wrapping
overflow: 'scroll', // Doesn't actually cause a scrollbar, but stops text from wrapping
},
codeText: {
color: changeOpacity(theme.centerChannelColor, 0.65),
fontSize: 12,
lineHeight: 18
lineHeight: 18,
},
plusMoreLinesText: {
color: changeOpacity(theme.centerChannelColor, 0.4),
fontSize: 11,
marginTop: 2
marginTop: 2,
},
language: {
alignItems: 'center',
@@ -230,12 +230,12 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
padding: 6,
position: 'absolute',
right: 0,
top: 0
top: 0,
},
languageText: {
color: theme.sidebarHeaderTextColor,
fontSize: 12
}
fontSize: 12,
},
};
});