Skip to content

Commit

Permalink
fix(eslint): comma always-multiline
Browse files Browse the repository at this point in the history
Signed-off-by: Godefroy Ponsinet <godefroy.ponsinet@outlook.com>
  • Loading branch information
90dy committed Aug 22, 2018
1 parent f42d289 commit 3f70da3
Show file tree
Hide file tree
Showing 23 changed files with 559 additions and 647 deletions.
3 changes: 1 addition & 2 deletions client/react-native/.eslintrc
Expand Up @@ -18,8 +18,7 @@
"rules": {
"no-console": "off",
"linebreak-style": "off",
"comma-dangle": [
"off",
"comma-dangle": ["error",
"always-multiline"
],
"no-multi-spaces": "off",
Expand Down
12 changes: 6 additions & 6 deletions client/react-native/common/components/Forms/ContactRequest.js
Expand Up @@ -6,7 +6,7 @@ import environment from '../../relay.js'
var fields = {
id: '',
email: '',
phone: ''
phone: '',
}

export default class ContactRequest extends Component {
Expand Down Expand Up @@ -69,7 +69,7 @@ const commit = (variables = {}) =>
variables,
onCompleted: (res, errs) =>
console.log('Response receive from server.', res, errs),
onError: err => console.error(err)
onError: err => console.error(err),
})

function handleRequestButton () {
Expand All @@ -93,7 +93,7 @@ const styles = StyleSheet.create({
contactView: {
marginTop: 50,
alignItems: 'center',
justifyContent: 'center'
justifyContent: 'center',
},
input: {
borderColor: 'gray',
Expand All @@ -102,10 +102,10 @@ const styles = StyleSheet.create({
height: 30,
fontSize: 20,
marginTop: 5,
marginBottom: 30
marginBottom: 30,
},
label: {
fontSize: 16,
fontWeight: 'bold'
}
fontWeight: 'bold',
},
})
4 changes: 2 additions & 2 deletions client/react-native/common/components/Library/Grid.js
Expand Up @@ -14,7 +14,7 @@ export const Block = ({
<View
style={[
{ flex, flexDirection, alignItems, alignSelf, justifyContent },
style
style,
]}
{...props}
>
Expand Down Expand Up @@ -51,5 +51,5 @@ export const Col = props => (

export default {
Row,
Col
Col,
}
10 changes: 5 additions & 5 deletions client/react-native/common/components/Library/Icon.js
Expand Up @@ -11,7 +11,7 @@ const Icon = ({ name, color, rotate, style, ...props }: { name: String }) => {
name
.split('-')
.splice(1)
.join('-')
.join('-'),
]
const iconProps = {
name: iconName,
Expand All @@ -20,12 +20,12 @@ const Icon = ({ name, color, rotate, style, ...props }: { name: String }) => {
{ color: color || colors.textGrey },
rotate && {
transform: [
{ rotate: typeof rotate === 'boolean' ? '90deg' : `${rotate}deg` }
]
{ rotate: typeof rotate === 'boolean' ? '90deg' : `${rotate}deg` },
],
},
style
style,
],
...props
...props,
}
switch (type) {
case 'feather':
Expand Down
8 changes: 4 additions & 4 deletions client/react-native/common/components/Library/Menu.js
Expand Up @@ -4,7 +4,7 @@ import {
StyleSheet,
ScrollView,
View,
TouchableOpacity
TouchableOpacity,
} from 'react-native'
import { Separator, CustomTextInput, Icon, Text } from '.'
import { Row, Col } from './Grid'
Expand All @@ -17,11 +17,11 @@ export default class Menu extends Component {
style={[
{
width: '100%',
backgroundColor: 'transparent'
backgroundColor: 'transparent',
},
marginTop,
!icon && !title && { marginTop: 32 },
style
style,
]}
>
<Row style={[marginTopLeft]}>
Expand All @@ -40,7 +40,7 @@ export default class Menu extends Component {

static Item = class Item extends Component {
state = {
delete: false
delete: false,
}

_delete = callback => () =>
Expand Down
10 changes: 5 additions & 5 deletions client/react-native/common/components/Library/Screen.js
Expand Up @@ -7,22 +7,22 @@ import { screen } from '../constants'

export type ScreenState = {
dimensions: { width: number, height: number },
orientation: 'portrait' | 'landscape'
orientation: 'portrait' | 'landscape',
}

export type ScreenProps = {
absolute: boolean,
style?: Object,
onResize?: ScreenState => any
onResize?: ScreenState => any,
}

export default class Screen extends Component<ScreenProps, ScreenState> {
state = {
dimensions: {
width: screen.dimensions.width,
height: screen.dimensions.height
height: screen.dimensions.height,
},
orientation: screen.orientation
orientation: screen.orientation,
}

_dimensions = screen.dimensions
Expand All @@ -39,7 +39,7 @@ export default class Screen extends Component<ScreenProps, ScreenState> {
this.setState(
{
dimensions: { width, height },
orientation: width < height ? 'portrait' : 'landscape'
orientation: width < height ? 'portrait' : 'landscape',
},
() => {
this.props.onResize && this.props.onResize(this.state)
Expand Down
27 changes: 14 additions & 13 deletions client/react-native/common/components/Library/Text.js
Expand Up @@ -14,7 +14,7 @@ import {
textTop,
textBottom,
bold,
shadow
shadow,
} from '../styles'
import { colors } from '../constants'

Expand All @@ -41,14 +41,14 @@ const getPadding = (
small: 6,
medium: 8,
large: 10,
big: 12
big: 12,
}
) => {
const padding = find({ inside: props, from: paddings, or: 'small' })
return {
padding,
paddingTop: padding / 3,
paddingBottom: padding / 3
paddingBottom: padding / 3,
}
}

Expand All @@ -59,14 +59,14 @@ const getBorderRadius = (
small: 3,
medium: 4,
large: 5,
big: 6
big: 6,
}
) => {
const borderRadius = props.rounded
? find({ inside: props, from: radiuses, or: 'small' })
: 0
return {
borderRadius
borderRadius,
}
}

Expand All @@ -77,7 +77,7 @@ const getSize = (
small: smallText,
medium: mediumText,
large: largeText,
big: bigText
big: bigText,
}
) => find({ inside: props, from: sizes, or: 'small' })

Expand All @@ -88,7 +88,7 @@ const getIconSize = (
small: mediumText,
medium: largeText,
large: largeText,
big: bigText
big: bigText,
}
) => find({ inside: props, from: sizes, or: 'small' })

Expand All @@ -97,7 +97,7 @@ const getHorizAlign = (
aligns = {
center: textCenter,
left: textLeft,
right: textRight
right: textRight,
}
) => find({ inside: props, from: aligns, or: 'center' })

Expand All @@ -106,12 +106,13 @@ const getVertiAlign = (
aligns = {
middle: textMiddle,
top: textTop,
bottom: textBottom
bottom: textBottom,
}
) => find({ inside: props, from: aligns, or: 'middle' })

const getColor = ({ background, color }) => ({
color: colors[color] || color || (background ? colors.white : colors.textGrey)
color:
colors[color] || color || (background ? colors.white : colors.textGrey),
})

const getWeight = props => props.bold && bold
Expand All @@ -125,11 +126,11 @@ export const BackgroundText = props => {
backgroundColor:
(background === true && colors.blackGrey) ||
background ||
colors.transparent
colors.transparent,
},
getBorderRadius(props),
getPadding(props),
props.shadow && shadow
props.shadow && shadow,
]}
>
{children}
Expand All @@ -145,7 +146,7 @@ export const ForegroundText = props => {
getSize(props),
getIconSize(props),
getWeight(props),
getColor(props)
getColor(props),
]
return (
<View style={{ flexDirection: 'row', justifyContent: 'flex-start' }}>
Expand Down
2 changes: 1 addition & 1 deletion client/react-native/common/constants/colors.js
Expand Up @@ -26,5 +26,5 @@ export default {
secondary: '#f1f1fc',
success: '#15D09D',
warning: '#FFD665',
error: '#F00062'
error: '#F00062',
}

0 comments on commit 3f70da3

Please sign in to comment.