Skip to content

Commit

Permalink
Merge pull request #2552 from oliviertassinari/eslint-key-spacing
Browse files Browse the repository at this point in the history
[eslint] Enforce key-spacing
  • Loading branch information
alitaheri committed Dec 16, 2015
2 parents 478819c + ffac85d commit b88661b
Show file tree
Hide file tree
Showing 41 changed files with 367 additions and 374 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ rules:
eol-last: 2
indent: [2, 2, {SwitchCase: 1}]
jsx-quotes: [2, prefer-double]
key-spacing: 0 # Wishlist, one day
key-spacing: 2
max-len: [2, 120, 4]
new-cap: [0, {capIsNew: true, newIsCap: true}] # Wishlist, one day
no-unused-expressions: 2
Expand Down
4 changes: 2 additions & 2 deletions docs/src/app/components/AppBar/ExampleIconMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const AppBarExampleIconMenu = React.createClass({
iconButtonElement={
<IconButton><MoreVertIcon /></IconButton>
}
targetOrigin={{horizontal:'right', vertical:'top'}}
anchorOrigin={{horizontal:'right', vertical:'top'}}
targetOrigin={{horizontal: 'right', vertical: 'top'}}
anchorOrigin={{horizontal: 'right', vertical: 'top'}}
>
<MenuItem primaryText="Refresh" />
<MenuItem primaryText="Help" />
Expand Down
4 changes: 2 additions & 2 deletions docs/src/app/components/code-example/code-example.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ const DefaultRawTheme = Styles.LightRawTheme;

const CodeExample = React.createClass({

propTypes : {
propTypes: {
children: React.PropTypes.node,
code: React.PropTypes.string.isRequired,
layoutSideBySide: React.PropTypes.bool,
},

contextTypes : {
contextTypes: {
muiTheme: React.PropTypes.object,
},

Expand Down
4 changes: 2 additions & 2 deletions docs/src/app/components/component-info.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const ComponentInfo = React.createClass({
position: 'inherit',
paddingRight: desktopGutter + 'px',
},
descWhenMedium :{
descWhenMedium: {
paddingTop: '16px',
},
tdWhenLarge: {
Expand All @@ -109,7 +109,7 @@ const ComponentInfo = React.createClass({
nameWhenLarge: {
minWidth: '128px',
},
descWhenLarge :{
descWhenLarge: {
paddingTop: '32px',
},
descWhenLastChild: {
Expand Down
5 changes: 2 additions & 3 deletions docs/src/app/components/master.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Master = React.createClass({
location: React.PropTypes.object,
},

childContextTypes : {
childContextTypes: {
muiTheme: React.PropTypes.object,
},

Expand Down Expand Up @@ -171,12 +171,11 @@ const Master = React.createClass({
},
tabs: {
width: 425,
bottom:0,
bottom: 0,
},
tab: {
height: 64,
},

};

let materialIcon = this.state.tabIndex !== '0' ? (
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/components/mobile-tear-sheet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {StylePropable} = Mixins;
const MobileTearSheet = React.createClass({
mixins: [StylePropable],

contextTypes : {
contextTypes: {
muiTheme: React.PropTypes.object,
},

Expand Down
4 changes: 2 additions & 2 deletions docs/src/app/components/pages/components/auto-complete.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ class AutoCompletePage extends React.Component {
dataSource={[
{
text: 'text-value1',
value:(<AutoComplete.Item primaryText={'text-value1'} secondaryText="&#9786;" />),
value: (<AutoComplete.Item primaryText={'text-value1'} secondaryText="&#9786;" />),
},
{
text: 'text-value2',
value:(<AutoComplete.Item primaryText={'text-value2'} secondaryText="&#9786;" />),
value: (<AutoComplete.Item primaryText={'text-value2'} secondaryText="&#9786;" />),
},
]}
onNewRequest={(t, index) => { console.log('request:' + index); }} />
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/components/pages/components/cards.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export default class CardPage extends React.Component {
<CardHeader
title="Title"
subtitle="Subtitle"
avatar={<Avatar style={{color:'red'}}>A</Avatar>}/>
avatar={<Avatar style={{color: 'red'}}>A</Avatar>}/>
<CardHeader
title="Demo Url Based Avatar"
subtitle="Subtitle"
Expand Down
4 changes: 2 additions & 2 deletions docs/src/app/components/pages/components/drop-down-menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export default class DropDownMenuPage extends React.Component {
let longMenuItems = [];
for (let i = 0; i < 100; i++ ) {
longMenuItems.push({
payload:i.toString(),
text:'Item ' + i,
payload: i.toString(),
text: 'Item ' + i,
});
}

Expand Down
32 changes: 16 additions & 16 deletions docs/src/app/components/pages/components/icon-menus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ export default class IconMenus extends React.Component {
<p>Menu with various open directions</p>
<div>
<IconMenu iconButtonElement={iconButtonElement}
anchorOrigin={{horizontal:'right', vertical:'top'}}
targetOrigin={{horizontal:'right', vertical:'top'}}>
anchorOrigin={{horizontal: 'right', vertical: 'top'}}
targetOrigin={{horizontal: 'right', vertical: 'top'}}>
<MenuItem primaryText="Refresh" />
<MenuItem primaryText="Send feedback" />
<MenuItem primaryText="Settings" />
Expand All @@ -210,8 +210,8 @@ export default class IconMenus extends React.Component {

<IconMenu
iconButtonElement={iconButtonElement}
anchorOrigin={{horizontal:'left', vertical:'top'}}
targetOrigin={{horizontal:'left', vertical:'top'}}>
anchorOrigin={{horizontal: 'left', vertical: 'top'}}
targetOrigin={{horizontal: 'left', vertical: 'top'}}>
<MenuItem primaryText="Refresh" />
<MenuItem primaryText="Send feedback" />
<MenuItem primaryText="Settings" />
Expand All @@ -221,8 +221,8 @@ export default class IconMenus extends React.Component {

<IconMenu
iconButtonElement={iconButtonElement}
anchorOrigin={{horizontal:'right', vertical:'bottom'}}
targetOrigin={{horizontal:'right', vertical:'bottom'}}>
anchorOrigin={{horizontal: 'right', vertical: 'bottom'}}
targetOrigin={{horizontal: 'right', vertical: 'bottom'}}>
<MenuItem primaryText="Refresh" />
<MenuItem primaryText="Send feedback" />
<MenuItem primaryText="Settings" />
Expand All @@ -232,8 +232,8 @@ export default class IconMenus extends React.Component {

<IconMenu
iconButtonElement={iconButtonElement}
anchorOrigin={{horizontal:'left', vertical:'bottom'}}
targetOrigin={{horizontal:'left', vertical:'bottom'}}>
anchorOrigin={{horizontal: 'left', vertical: 'bottom'}}
targetOrigin={{horizontal: 'left', vertical: 'bottom'}}>
<MenuItem primaryText="Refresh" />
<MenuItem primaryText="Send feedback" />
<MenuItem primaryText="Settings" />
Expand Down Expand Up @@ -327,8 +327,8 @@ export default class IconMenus extends React.Component {
<IconMenu
iconButtonElement={mapsButtonElement}
maxHeight={272}
anchorOrigin={{horizontal:'right', vertical:'top'}}
targetOrigin={{horizontal:'right', vertical:'top'}}
anchorOrigin={{horizontal: 'right', vertical: 'top'}}
targetOrigin={{horizontal: 'right', vertical: 'top'}}
valueLink={usStateValueLink}>
<MenuItem value="AL" primaryText="Alabama" />
<MenuItem value="AK" primaryText="Alaska" />
Expand Down Expand Up @@ -386,8 +386,8 @@ export default class IconMenus extends React.Component {
<IconMenu
iconButtonElement={mapsButtonElement}
maxHeight={272}
anchorOrigin={{horizontal:'left', vertical:'top'}}
targetOrigin={{horizontal:'left', vertical:'top'}}
anchorOrigin={{horizontal: 'left', vertical: 'top'}}
targetOrigin={{horizontal: 'left', vertical: 'top'}}
valueLink={usStateValueLink}>
<MenuItem value="AL" primaryText="Alabama" />
<MenuItem value="AK" primaryText="Alaska" />
Expand Down Expand Up @@ -445,8 +445,8 @@ export default class IconMenus extends React.Component {
<IconMenu
iconButtonElement={mapsButtonElement}
maxHeight={272}
anchorOrigin={{horizontal:'right', vertical:'bottom'}}
targetOrigin={{horizontal:'right', vertical:'bottom'}}
anchorOrigin={{horizontal: 'right', vertical: 'bottom'}}
targetOrigin={{horizontal: 'right', vertical: 'bottom'}}
valueLink={usStateValueLink}>
<MenuItem value="AL" primaryText="Alabama" />
<MenuItem value="AK" primaryText="Alaska" />
Expand Down Expand Up @@ -504,8 +504,8 @@ export default class IconMenus extends React.Component {
<IconMenu
iconButtonElement={mapsButtonElement}
maxHeight={272}
anchorOrigin={{horizontal:'left', vertical:'bottom'}}
targetOrigin={{horizontal:'left', vertical:'bottom'}}
anchorOrigin={{horizontal: 'left', vertical: 'bottom'}}
targetOrigin={{horizontal: 'left', vertical: 'bottom'}}
valueLink={usStateValueLink}>
<MenuItem value="AL" primaryText="Alabama" />
<MenuItem value="AK" primaryText="Alaska" />
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/components/pages/components/lists.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ import ListItem from 'material-ui/lib/lists/list-item';
<ListItem
primaryText="Adelle Charles"
leftAvatar={<Avatar color={Colors.pinkA200} backgroundColor={Colors.transparent}
style={{left:8}}>A</Avatar>}
style={{left: 8}}>A</Avatar>}
rightAvatar={<Avatar src="images/adellecharles-128.jpg" />} />
<ListItem
primaryText="Adham Dannaway"
Expand Down
34 changes: 17 additions & 17 deletions docs/src/app/components/pages/components/popover.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import CodeExample from '../../code-example/code-example';
let PopoverPage = React.createClass({
getInitialState() {
return {
selectValue:'1',
textValue:'here is a value',
activePopover:'none',
anchorOrigin:{horizontal:'left', vertical:'bottom'},
targetOrigin:{horizontal:'left', vertical:'top'},
selectValue: '1',
textValue: 'here is a value',
activePopover: 'none',
anchorOrigin: {horizontal: 'left', vertical: 'bottom'},
targetOrigin: {horizontal: 'left', vertical: 'top'},
};
},

Expand Down Expand Up @@ -114,7 +114,7 @@ let PopoverPage = React.createClass({
targetOrigin: {JSON.stringify(this.state.targetOrigin)}
</pre>
<h3>Anchor Origin</h3>
<div style={{float:'left'}}>
<div style={{float: 'left'}}>
<strong>Vertical</strong>
<RadioButton onClick={this.setAnchor.bind(this, 'vertical', 'top')}
label="Top" checked={this.state.anchorOrigin.vertical === 'top'} />
Expand All @@ -123,7 +123,7 @@ let PopoverPage = React.createClass({
<RadioButton onClick={this.setAnchor.bind(this, 'vertical', 'bottom')}
label="Bottom" checked={this.state.anchorOrigin.vertical === 'bottom'} />
</div>
<div style={{float:'left'}}>
<div style={{float: 'left'}}>
<strong>Horizontal</strong>
<RadioButton onClick={this.setAnchor.bind(this, 'horizontal', 'left')}
label="Left" checked={this.state.anchorOrigin.horizontal === 'left'} />
Expand All @@ -132,11 +132,11 @@ let PopoverPage = React.createClass({
<RadioButton onClick={this.setAnchor.bind(this, 'horizontal', 'right')}
label="Right" checked={this.state.anchorOrigin.horizontal === 'right'} />
</div>
<br style={{clear:'both'}} />
<br style={{clear:'both'}} />
<br style={{clear: 'both'}} />
<br style={{clear: 'both'}} />

<h3>Target Origin</h3>
<div style={{float:'left'}}>
<div style={{float: 'left'}}>
<strong>Vertical</strong>
<RadioButton onClick={this.setTarget.bind(this, 'vertical', 'top')}
label="Top" checked={this.state.targetOrigin.vertical === 'top'} />
Expand All @@ -145,7 +145,7 @@ let PopoverPage = React.createClass({
<RadioButton onClick={this.setTarget.bind(this, 'vertical', 'bottom')}
label="Bottom" checked={this.state.targetOrigin.vertical === 'bottom'} />
</div>
<div style={{float:'left'}}>
<div style={{float: 'left'}}>
<strong>Horizontal</strong>
<RadioButton onClick={this.setTarget.bind(this, 'horizontal', 'left')}
label="Left" checked={this.state.targetOrigin.horizontal === 'left'} />
Expand All @@ -160,7 +160,7 @@ let PopoverPage = React.createClass({
anchorOrigin={this.state.anchorOrigin}
targetOrigin={this.state.targetOrigin}
onRequestClose={this.closePopover.bind(this, 'pop')} >
<div style={{padding:20}}>
<div style={{padding: 20}}>
<h2>Here is an arbitrary popover</h2>
<p>Hi - here is some content</p>
<RaisedButton primary={true} label="Here is a button"/>
Expand All @@ -173,16 +173,16 @@ let PopoverPage = React.createClass({

show(key, e) {
this.setState({
activePopover:key,
anchorEl:e.currentTarget,
activePopover: key,
anchorEl: e.currentTarget,
});
},

closePopover(key) {
if (this.state.activePopover !== key)
return;
this.setState({
activePopover:'none',
activePopover: 'none',
});
},

Expand All @@ -191,7 +191,7 @@ let PopoverPage = React.createClass({
anchorOrigin[positionElement] = position;

this.setState({
anchorOrigin:anchorOrigin,
anchorOrigin: anchorOrigin,
});
},

Expand All @@ -200,7 +200,7 @@ let PopoverPage = React.createClass({
targetOrigin[positionElement] = position;

this.setState({
targetOrigin:targetOrigin,
targetOrigin: targetOrigin,
});
},

Expand Down
10 changes: 5 additions & 5 deletions docs/src/app/components/pages/components/select-fields.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,11 @@ const SelectFieldsPage = React.createClass({
{payload: '5', text: 'Weekly'},
];
let arbitraryArrayMenuItems = [
{id:1, name:'Never'},
{id:2, name:'Every Night'},
{id:3, name:'Weeknights'},
{id:4, name:'Weekends'},
{id:5, name:'Weekly'},
{id: 1, name: 'Never'},
{id: 2, name: 'Every Night'},
{id: 3, name: 'Weeknights'},
{id: 4, name: 'Weekends'},
{id: 5, name: 'Weekly'},
];
let menuItemsWithLabel = [
{payload: '1', text: 'Morning', period: '5 am - 12 pm'},
Expand Down
6 changes: 3 additions & 3 deletions docs/src/app/components/pages/components/switches.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -481,17 +481,17 @@ export default class SwitchesPage extends React.Component {
id="radioButtonId1"
value="light"
label="prepare for light speed"
style={{marginBottom:16}} />
style={{marginBottom: 16}} />
<RadioButton
id="radioButtonId2"
value="not_light"
label="light speed too slow"
style={{marginBottom:16}}/>
style={{marginBottom: 16}}/>
<RadioButton
id="radioButtonId3"
value="ludicrous"
label="go to ludicrous speed"
style={{marginBottom:16}}
style={{marginBottom: 16}}
disabled={true}/>
</RadioButtonGroup>
</div>
Expand Down
6 changes: 3 additions & 3 deletions docs/src/app/components/pages/components/text-fields.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ The textarea also grows and shrinks according to the number of lines.`,
style={styles.textfield}
hintText="Custom Underline Color"
value={this.state.propValue}
underlineStyle={{borderColor:Colors.green500}}
underlineStyle={{borderColor: Colors.green500}}
onChange={this._handleInputChange} /><br/>
<TextField
style={styles.textfield}
Expand All @@ -274,7 +274,7 @@ The textarea also grows and shrinks according to the number of lines.`,
style={styles.textfield}
disabled={true}
hintText="Custom Underline Disabled Style"
underlineDisabledStyle={{borderColor:Colors.purple500, borderBottom: 'solid 1px'}} /><br />
underlineDisabledStyle={{borderColor: Colors.purple500, borderBottom: 'solid 1px'}} /><br />
<TextField
style={styles.textfield}
hintText="Hint Text"
Expand Down Expand Up @@ -306,7 +306,7 @@ The textarea also grows and shrinks according to the number of lines.`,
style={styles.textfield}
hintText="Hint Text (custom error color)"
errorText={this.state.error2Text}
errorStyle={{color:Colors.orange500}}
errorStyle={{color: Colors.orange500}}
onChange={this._handleError2InputChange}
defaultValue="Custom error color" /><br/>
<TextField
Expand Down
2 changes: 1 addition & 1 deletion docs/src/app/components/pages/customization/themes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const ThemesPage = React.createClass({

mixins: [StylePropable, StyleResizable],

contextTypes : {
contextTypes: {
muiTheme: React.PropTypes.object,
},

Expand Down
Loading

0 comments on commit b88661b

Please sign in to comment.