From ffac85dff98a682fb7f1c15b21f9785b3135bfe3 Mon Sep 17 00:00:00 2001
From: Olivier Tassinari
Date: Wed, 16 Dec 2015 14:04:20 +0100
Subject: [PATCH] [eslint] Enforce key-spacing
---
.eslintrc | 2 +-
.../app/components/AppBar/ExampleIconMenu.jsx | 4 +-
.../components/code-example/code-example.jsx | 4 +-
docs/src/app/components/component-info.jsx | 4 +-
docs/src/app/components/master.jsx | 5 +-
docs/src/app/components/mobile-tear-sheet.jsx | 2 +-
.../pages/components/auto-complete.jsx | 4 +-
.../app/components/pages/components/cards.jsx | 2 +-
.../pages/components/drop-down-menu.jsx | 4 +-
.../pages/components/icon-menus.jsx | 32 +-
.../app/components/pages/components/lists.jsx | 2 +-
.../components/pages/components/popover.jsx | 34 +-
.../pages/components/select-fields.jsx | 10 +-
.../components/pages/components/switches.jsx | 6 +-
.../pages/components/text-fields.jsx | 6 +-
.../components/pages/customization/themes.jsx | 2 +-
.../components/pages/get-started/examples.jsx | 2 +-
.../pages/get-started/installation.jsx | 2 +-
.../pages/get-started/prerequisites.jsx | 2 +-
src/auto-complete.jsx | 18 +-
src/card/card-header.jsx | 2 +-
src/card/card-media.jsx | 2 +-
src/drop-down-menu.jsx | 32 +-
src/index.js | 2 +-
src/lists/list-item.jsx | 2 +-
src/menu/link-menu-item.jsx | 2 +-
src/menu/menu.jsx | 6 +-
src/menus/icon-menu.jsx | 10 +-
src/popover/popover-animation-from-top.jsx | 14 +-
src/popover/popover-default-animation.jsx | 30 +-
src/popover/popover.jsx | 6 +-
src/raised-button.jsx | 2 +-
src/styles/colors.js | 456 +++++++++---------
src/styles/theme-decorator.js | 2 +-
src/styles/theme-manager.js | 2 +-
src/table/table-header-column.jsx | 2 +-
src/table/table-header.jsx | 2 +-
src/time-picker/time-picker-dialog.jsx | 2 +-
src/utils/css-event.js | 8 +-
src/utils/prop-types.js | 6 +-
test/theming-v12-spec.js | 4 +-
41 files changed, 367 insertions(+), 374 deletions(-)
diff --git a/.eslintrc b/.eslintrc
index 783985f791a3b9..29ea8d84548469 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -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
diff --git a/docs/src/app/components/AppBar/ExampleIconMenu.jsx b/docs/src/app/components/AppBar/ExampleIconMenu.jsx
index 121d7c61bce2d5..33b670ccc4e4a9 100644
--- a/docs/src/app/components/AppBar/ExampleIconMenu.jsx
+++ b/docs/src/app/components/AppBar/ExampleIconMenu.jsx
@@ -17,8 +17,8 @@ const AppBarExampleIconMenu = React.createClass({
iconButtonElement={
}
- targetOrigin={{horizontal:'right', vertical:'top'}}
- anchorOrigin={{horizontal:'right', vertical:'top'}}
+ targetOrigin={{horizontal: 'right', vertical: 'top'}}
+ anchorOrigin={{horizontal: 'right', vertical: 'top'}}
>
diff --git a/docs/src/app/components/code-example/code-example.jsx b/docs/src/app/components/code-example/code-example.jsx
index cbf24fdedb2956..824b4576a491a1 100644
--- a/docs/src/app/components/code-example/code-example.jsx
+++ b/docs/src/app/components/code-example/code-example.jsx
@@ -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,
},
diff --git a/docs/src/app/components/component-info.jsx b/docs/src/app/components/component-info.jsx
index 1a4d715f67c31f..9359f8ebfd9c03 100644
--- a/docs/src/app/components/component-info.jsx
+++ b/docs/src/app/components/component-info.jsx
@@ -100,7 +100,7 @@ const ComponentInfo = React.createClass({
position: 'inherit',
paddingRight: desktopGutter + 'px',
},
- descWhenMedium :{
+ descWhenMedium: {
paddingTop: '16px',
},
tdWhenLarge: {
@@ -109,7 +109,7 @@ const ComponentInfo = React.createClass({
nameWhenLarge: {
minWidth: '128px',
},
- descWhenLarge :{
+ descWhenLarge: {
paddingTop: '32px',
},
descWhenLastChild: {
diff --git a/docs/src/app/components/master.jsx b/docs/src/app/components/master.jsx
index 478b4e88756589..185733effd4af0 100644
--- a/docs/src/app/components/master.jsx
+++ b/docs/src/app/components/master.jsx
@@ -35,7 +35,7 @@ const Master = React.createClass({
location: React.PropTypes.object,
},
- childContextTypes : {
+ childContextTypes: {
muiTheme: React.PropTypes.object,
},
@@ -171,12 +171,11 @@ const Master = React.createClass({
},
tabs: {
width: 425,
- bottom:0,
+ bottom: 0,
},
tab: {
height: 64,
},
-
};
let materialIcon = this.state.tabIndex !== '0' ? (
diff --git a/docs/src/app/components/mobile-tear-sheet.jsx b/docs/src/app/components/mobile-tear-sheet.jsx
index 5ae9dbe4478530..d1d475d5c45279 100644
--- a/docs/src/app/components/mobile-tear-sheet.jsx
+++ b/docs/src/app/components/mobile-tear-sheet.jsx
@@ -6,7 +6,7 @@ const {StylePropable} = Mixins;
const MobileTearSheet = React.createClass({
mixins: [StylePropable],
- contextTypes : {
+ contextTypes: {
muiTheme: React.PropTypes.object,
},
diff --git a/docs/src/app/components/pages/components/auto-complete.jsx b/docs/src/app/components/pages/components/auto-complete.jsx
index 0bf9f1ac97b10e..b3bb40480dae8f 100644
--- a/docs/src/app/components/pages/components/auto-complete.jsx
+++ b/docs/src/app/components/pages/components/auto-complete.jsx
@@ -62,11 +62,11 @@ class AutoCompletePage extends React.Component {
dataSource={[
{
text: 'text-value1',
- value:(),
+ value: (),
},
{
text: 'text-value2',
- value:(),
+ value: (),
},
]}
onNewRequest={(t, index) => { console.log('request:' + index); }} />
diff --git a/docs/src/app/components/pages/components/cards.jsx b/docs/src/app/components/pages/components/cards.jsx
index 843d0de889bb4a..1b527326e0acef 100644
--- a/docs/src/app/components/pages/components/cards.jsx
+++ b/docs/src/app/components/pages/components/cards.jsx
@@ -117,7 +117,7 @@ export default class CardPage extends React.Component {
A}/>
+ avatar={A}/>
Menu with various open directions
+ anchorOrigin={{horizontal: 'right', vertical: 'top'}}
+ targetOrigin={{horizontal: 'right', vertical: 'top'}}>
@@ -210,8 +210,8 @@ export default class IconMenus extends React.Component {
+ anchorOrigin={{horizontal: 'left', vertical: 'top'}}
+ targetOrigin={{horizontal: 'left', vertical: 'top'}}>
@@ -221,8 +221,8 @@ export default class IconMenus extends React.Component {
+ anchorOrigin={{horizontal: 'right', vertical: 'bottom'}}
+ targetOrigin={{horizontal: 'right', vertical: 'bottom'}}>
@@ -232,8 +232,8 @@ export default class IconMenus extends React.Component {
+ anchorOrigin={{horizontal: 'left', vertical: 'bottom'}}
+ targetOrigin={{horizontal: 'left', vertical: 'bottom'}}>
@@ -327,8 +327,8 @@ export default class IconMenus extends React.Component {
@@ -386,8 +386,8 @@ export default class IconMenus extends React.Component {
@@ -445,8 +445,8 @@ export default class IconMenus extends React.Component {
@@ -504,8 +504,8 @@ export default class IconMenus extends React.Component {
diff --git a/docs/src/app/components/pages/components/lists.jsx b/docs/src/app/components/pages/components/lists.jsx
index 35908ad1bb9f54..e88f27b62512c6 100644
--- a/docs/src/app/components/pages/components/lists.jsx
+++ b/docs/src/app/components/pages/components/lists.jsx
@@ -430,7 +430,7 @@ import ListItem from 'material-ui/lib/lists/list-item';
A}
+ style={{left: 8}}>A}
rightAvatar={} />
Anchor Origin
-
+
Vertical
@@ -123,7 +123,7 @@ let PopoverPage = React.createClass({
-
+
Horizontal
@@ -132,11 +132,11 @@ let PopoverPage = React.createClass({
-
-
+
+
Target Origin
-
+
Vertical
@@ -145,7 +145,7 @@ let PopoverPage = React.createClass({
-
+
Horizontal
@@ -160,7 +160,7 @@ let PopoverPage = React.createClass({
anchorOrigin={this.state.anchorOrigin}
targetOrigin={this.state.targetOrigin}
onRequestClose={this.closePopover.bind(this, 'pop')} >
-
+
Here is an arbitrary popover
Hi - here is some content
@@ -173,8 +173,8 @@ let PopoverPage = React.createClass({
show(key, e) {
this.setState({
- activePopover:key,
- anchorEl:e.currentTarget,
+ activePopover: key,
+ anchorEl: e.currentTarget,
});
},
@@ -182,7 +182,7 @@ let PopoverPage = React.createClass({
if (this.state.activePopover !== key)
return;
this.setState({
- activePopover:'none',
+ activePopover: 'none',
});
},
@@ -191,7 +191,7 @@ let PopoverPage = React.createClass({
anchorOrigin[positionElement] = position;
this.setState({
- anchorOrigin:anchorOrigin,
+ anchorOrigin: anchorOrigin,
});
},
@@ -200,7 +200,7 @@ let PopoverPage = React.createClass({
targetOrigin[positionElement] = position;
this.setState({
- targetOrigin:targetOrigin,
+ targetOrigin: targetOrigin,
});
},
diff --git a/docs/src/app/components/pages/components/select-fields.jsx b/docs/src/app/components/pages/components/select-fields.jsx
index f223fe6e4f8fc8..15b59b7441c45d 100644
--- a/docs/src/app/components/pages/components/select-fields.jsx
+++ b/docs/src/app/components/pages/components/select-fields.jsx
@@ -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'},
diff --git a/docs/src/app/components/pages/components/switches.jsx b/docs/src/app/components/pages/components/switches.jsx
index 1144b23c84fc36..7193d360e7b85d 100644
--- a/docs/src/app/components/pages/components/switches.jsx
+++ b/docs/src/app/components/pages/components/switches.jsx
@@ -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}} />
+ style={{marginBottom: 16}}/>
diff --git a/docs/src/app/components/pages/components/text-fields.jsx b/docs/src/app/components/pages/components/text-fields.jsx
index 7e171a55d8e87e..58f7dfb1fb18f8 100644
--- a/docs/src/app/components/pages/components/text-fields.jsx
+++ b/docs/src/app/components/pages/components/text-fields.jsx
@@ -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} />
+ underlineDisabledStyle={{borderColor: Colors.purple500, borderBottom: 'solid 1px'}} />
this.setState({open:false})}
+ onEscKeyDown={() => this.setState({open: false})}
onItemTouchTap={this._handleItemTouchTap}
listStyle={this.mergeAndPrefix(styles.list, listStyle)}
openDirection="bottom-left"
@@ -176,7 +176,7 @@ const AutoComplete = React.createClass({
return (