Skip to content

Commit

Permalink
Merge pull request #2381 from oliviertassinari/eslint-max-len
Browse files Browse the repository at this point in the history
[eslint] Enforce max-len
  • Loading branch information
oliviertassinari committed Dec 5, 2015
2 parents cde9bd3 + a56600a commit dc73f45
Show file tree
Hide file tree
Showing 44 changed files with 473 additions and 236 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ rules:
indent: [2, 2, {SwitchCase: 1}]
jsx-quotes: [2, prefer-double]
key-spacing: 0 # Wishlist, one day
max-len: [0, 120, 4] # Wishlist, one day
max-len: [2, 120, 4]
new-cap: [0, {capIsNew: true, newIsCap: true}] # Wishlist, one day
no-unused-expressions: 2
no-unused-vars: 2
Expand Down
38 changes: 31 additions & 7 deletions docs/src/app/components/app-left-nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,37 @@ const {Colors, Spacing, Typography} = Styles;
const {StylePropable} = Mixins;

const menuItems = [
{route: 'get-started', text: 'Get Started'},
{route: 'customization', text: 'Customization'},
{route: 'components', text: 'Components'},
{type: MenuItem.Types.SUBHEADER, text: 'Resources'},
{type: MenuItem.Types.LINK, payload: 'https://github.com/callemall/material-ui', text: 'GitHub'},
{type: MenuItem.Types.LINK, payload: 'http://facebook.github.io/react', text: 'React'},
{type: MenuItem.Types.LINK, payload: 'https://www.google.com/design/spec/material-design/introduction.html', text: 'Material Design'},
{
route: 'get-started',
text: 'Get Started',
},
{
route: 'customization',
text: 'Customization',
},
{
route: 'components',
text: 'Components',
},
{
type: MenuItem.Types.SUBHEADER,
text: 'Resources',
},
{
type: MenuItem.Types.LINK,
payload: 'https://github.com/callemall/material-ui',
text: 'GitHub',
},
{
type: MenuItem.Types.LINK,
payload: 'http://facebook.github.io/react',
text: 'React',
},
{
type: MenuItem.Types.LINK,
payload: 'https://www.google.com/design/spec/material-design/introduction.html',
text: 'Material Design',
},
];


Expand Down
6 changes: 4 additions & 2 deletions docs/src/app/components/master.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ const Master = React.createClass({
<AppLeftNav ref="leftNav" history={this.props.history} />
<FullWidthSection style={styles.footer}>
<p style={this.prepareStyles(styles.p)}>
Hand crafted with love by the engineers at <a style={styles.a} href="http://call-em-all.com">Call-Em-All</a> and our
awesome <a style={this.prepareStyles(styles.a)} href="https://github.com/callemall/material-ui/graphs/contributors">contributors</a>.
Hand crafted with love by the engineers at
<a style={styles.a} href="http://call-em-all.com">Call-Em-All</a> and our
awesome <a style={this.prepareStyles(styles.a)}
href="https://github.com/callemall/material-ui/graphs/contributors">contributors</a>.
</p>
{githubButton2}
</FullWidthSection>
Expand Down
3 changes: 2 additions & 1 deletion docs/src/app/components/pages/components/app-bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ export default class AppBarPage extends React.Component {
name: 'title',
type: 'node',
header: 'optional',
desc: 'The title to display on the app bar. Could be number, string, element or an array containing these types.',
desc: 'The title to display on the app bar. ' +
'Could be number, string, element or an array containing these types.',
},
{
name: 'zDepth',
Expand Down
3 changes: 2 additions & 1 deletion docs/src/app/components/pages/components/avatars.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ export default class AvatarsPage extends React.Component {
let svgAvatar = <Avatar icon={<FileFolder />} />;
let customSvgAvatar = <Avatar icon={<FileFolder />} color={Colors.orange200} backgroundColor={Colors.pink400} />;
let fontAvatar = <Avatar icon={<FontIcon className="muidocs-icon-communication-voicemail" />} />;
let customFontAvatar = <Avatar icon={<FontIcon className="muidocs-icon-communication-voicemail" />} color={Colors.blue300} backgroundColor={Colors.indigo900} />;
let customFontAvatar = <Avatar icon={<FontIcon className="muidocs-icon-communication-voicemail" />}
color={Colors.blue300} backgroundColor={Colors.indigo900} />;
let letterAvatar = <Avatar>A</Avatar>;
let customLetterAvatar = <Avatar color={Colors.deepOrange300} backgroundColor={Colors.purple500}>A</Avatar>;

Expand Down
36 changes: 23 additions & 13 deletions docs/src/app/components/pages/components/buttons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ export default class ButtonPage extends React.Component {
name: 'containerElement',
type: 'oneOfType [string, element]',
header: 'default: button',
desc: 'This component will render a button element by default and an anchor element if linkButton is set to true. ' +
'However, you can override this behavior by passing in a string or another react element into this prop. This is ' +
desc: 'This component will render a button element by default and an anchor element ' +
'if linkButton is set to true. ' +
'However, you can override this behavior by passing in a string or another react ' +
'element into this prop. This is ' +
'useful for generating link buttons with the react router link element.',
},
{
Expand All @@ -59,8 +61,10 @@ export default class ButtonPage extends React.Component {
name: 'label or children',
type: 'string (label) or HTML/React elements (children)',
header: 'required',
desc: 'This is what will be displayed inside the button. If a label is specified, the text within the label prop will be displayed.' +
' Otherwise, the component will expect children which will then be displayed (in our example, we are nesting an <input type="file" />' +
desc: 'This is what will be displayed inside the button. If a label is specified,' +
' the text within the label prop will be displayed.' +
' Otherwise, the component will expect children which will then be displayed (in our example, ' +
' we are nesting an <input type="file" />' +
'and a span that acts as our label to be displayed.) ' +
'This only applies to flat and raised buttons.',
},
Expand Down Expand Up @@ -115,8 +119,10 @@ export default class ButtonPage extends React.Component {
name: 'containerElement',
type: 'oneOfType [string, element]',
header: 'default: button',
desc: 'This component will render a button element by default and an anchor element if linkButton is set to true. ' +
'However, you can override this behavior by passing in a string or another react element into this prop. This is ' +
desc: 'This component will render a button element by default and an anchor' +
' element if linkButton is set to true. ' +
'However, you can override this behavior by passing in a string or another ' +
'react element into this prop. This is ' +
'useful for generating link buttons with the react router link element.',
},
{
Expand All @@ -135,8 +141,10 @@ export default class ButtonPage extends React.Component {
name: 'label or children',
type: 'string (label) or HTML/React elements (children)',
header: 'required',
desc: 'This is what will be displayed inside the button. If a label is specified, the text within the label prop will be displayed.' +
' Otherwise, the component will expect children which will then be displayed (in our example, we are nesting an <input type="file" />' +
desc: 'This is what will be displayed inside the button. If a label is specified, the text' +
' within the label prop will be displayed.' +
' Otherwise, the component will expect children which will then be displayed ' +
'(in our example, we are nesting an <input type="file" />' +
'and a span that acts as our label to be displayed.) ' +
'This only applies to flat and raised buttons.',
},
Expand Down Expand Up @@ -209,16 +217,18 @@ export default class ButtonPage extends React.Component {
name: 'backgroundColor',
type: 'string',
header: 'optional',
desc: 'This value will override the default background color for the button. However it will not override the' +
'default disabled background color. This has to be set separately using the disabledColor attribute.',
desc: `This value will override the default background color for the button.
However it will not override the default disabled background color.
This has to be set separately using the disabledColor attribute.`,
},
{
name: 'containerElement',
type: 'oneOfType [string, element]',
header: 'default: button',
desc: 'This component will render a button element by default and an anchor element if linkButton is set to true. ' +
'However, you can override this behavior by passing in a string or another react element into this prop. This is ' +
'useful for generating link buttons with the react router link element.',
desc: `This component will render a button element by default and an anchor element
if linkButton is set to true.
However, you can override this behavior by passing in a string or another react element into this prop.
This is useful for generating link buttons with the react router link element.`,
},
{
name: 'disabled',
Expand Down
16 changes: 10 additions & 6 deletions docs/src/app/components/pages/components/dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export default class DialogPage extends React.Component {
name: 'actions',
type: 'array',
header: 'optional',
desc: 'This prop can be either a JSON object containing the actions to render, or an array of react objects.',
desc: `This prop can be either a JSON object containing the actions to render,
or an array of react objects.`,
},
{
name: 'actionFocus',
Expand Down Expand Up @@ -77,7 +78,8 @@ export default class DialogPage extends React.Component {
name: 'modal',
type: 'bool',
header: 'default: false',
desc: 'Force the user to use one of the actions in the dialog. Clicking outside the dialog will not dismiss the dialog.',
desc: `Force the user to use one of the actions in the dialog.
Clicking outside the dialog will not dismiss the dialog.`,
},
{
name: 'Deprecated: openImmediately',
Expand All @@ -101,14 +103,15 @@ export default class DialogPage extends React.Component {
name: 'title',
type: 'node',
header: 'optional',
desc: 'The title to display on the dialog. Could be number, string, element or an array containing these types.',
desc: `The title to display on the dialog.
Could be number, string, element or an array containing these types.`,
},
{
name: 'autoDetectWindowHeight',
type: 'bool',
header: 'default: true',
desc: 'If set to true, the height of the dialog will be auto detected. A max height will be enforced so that the '
+ 'content does not extend beyond the viewport.',
desc: `If set to true, the height of the dialog will be auto detected.
A max height will be enforced so that the content does not extend beyond the viewport.`,
},
{
name: 'autoScrollBodyContent',
Expand Down Expand Up @@ -210,7 +213,8 @@ export default class DialogPage extends React.Component {
<br/><br/>
<RaisedButton label="Custom Actions" onTouchTap={this._handleCustomDialogTouchTap} />
<br/><br/>
<RaisedButton label="Scrollable Content And Custom Actions" onTouchTap={this._handleScrollableDialogTouchTap} />
<RaisedButton label="Scrollable Content And Custom Actions"
onTouchTap={this._handleScrollableDialogTouchTap} />

<Dialog
ref="standardDialog"
Expand Down
27 changes: 16 additions & 11 deletions docs/src/app/components/pages/components/grid-list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,23 @@ class GridListPage extends React.Component {
name: 'titlePosition',
type: 'oneOf ["top", "bottom"]',
header: 'optional',
desc: 'Position of the title bar (container of title, subtitle and action icon). Defaults to "bottom".',
desc: `Position of the title bar (container of title, subtitle and action icon).
Defaults to "bottom".`,
},
{
name: 'titleBackground',
type: 'string',
header: 'optional',
desc: 'Style used for title bar background. Defaults to "rgba(0, 0, 0, 0.4)". Useful for setting custom gradients for example',
desc: `Style used for title bar background.
Defaults to "rgba(0, 0, 0, 0.4)".
Useful for setting custom gradients for example`,
},
{
name: 'actionIcon',
type: 'element',
header: 'optional',
desc: 'An IconButton element to be used as secondary action target (primary action target is the tile itself).',
desc: `An IconButton element to be used as secondary action target
(primary action target is the tile itself).`,
},
{
name: 'actionPosition',
Expand Down Expand Up @@ -117,19 +121,20 @@ class GridListPage extends React.Component {
name: 'rootClass',
type: 'string|ReactComponent',
header: 'optional',
desc: 'Either a string used as tag name for the tile root element, or a ReactComponent. Defaults to "div".' +
'This is useful when you have, for example, a custom implementation of a navigation link (that knows' +
'about your routes) and you want to use it as primary tile action. In case you pass a ReactComponent' +
', please make sure that it passes all props, accepts styles overrides and render it\'s children.',

desc: `Either a string used as tag name for the tile root element, or a ReactComponent.
Defaults to "div".
This is useful when you have, for example,
a custom implementation of a navigation link (that knows about your routes)
and you want to use it as primary tile action. In case you pass a ReactComponent,
please make sure that it passes all props, accepts styles overrides and render it's children.`,
},
{
name: 'children',
type: 'node',
header: 'required',
desc: 'Theoretically you can pass any node as children, but the main use case is to pass an img, in which' +
'case GridTile takes care of making the image "cover" available space (similar to background-size: cover' +
' or to object-fit:cover)',
desc: `Theoretically you can pass any node as children, but the main use case is to pass an img,
in which case GridTile takes care of making the image "cover" available space
(similar to background-size: cover or to object-fit:cover)`,
},
],
},
Expand Down
31 changes: 17 additions & 14 deletions docs/src/app/components/pages/components/icon-buttons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ export default class IconButtonsPage extends React.Component {
</li>
<li>
For svg icons: Insert the svg component as a child of icon
buttons. This is the method we are using. <a title="Source
code for ActionGrade" href="https://github.com/callemall/material-ui/blob/master/src/svg-icons/action/grade.jsx">
buttons. This is the method we are using.
<a title="Source code for ActionGrade"
href="https://github.com/callemall/material-ui/blob/master/src/svg-icons/action/grade.jsx">
View our source</a> to see how ActionGrade was created
using mui.SvgIcon.
</li>
Expand Down Expand Up @@ -81,7 +82,8 @@ export default class IconButtonsPage extends React.Component {
name: 'tooltipPosition',
type: 'string',
header: 'default: bottom-center',
desc: 'Allows the tooltip to be viewed with different alignments: "bottom-center", "top-center", "bottom-right", "top-right", "bottom-left" and "top-left"',
desc: `Allows the tooltip to be viewed with different alignments:
"bottom-center", "top-center", "bottom-right", "top-right", "bottom-left" and "top-left"`,
},
{
name: 'tooltipStyles',
Expand Down Expand Up @@ -135,17 +137,18 @@ export default class IconButtonsPage extends React.Component {
</Paper>

<CodeExample code={Code}>
<IconButton iconClassName="muidocs-icon-custom-github" tooltip="bottom-right" tooltipPosition = "bottom-right" />

<IconButton iconClassName="muidocs-icon-custom-github" tooltip="bottom-center" tooltipPosition = "bottom-center" />

<IconButton iconClassName="muidocs-icon-custom-github" tooltip="bottom-left" tooltipPosition = "bottom-left" />

<IconButton iconClassName="muidocs-icon-custom-github" tooltip="top-right" tooltipPosition = "top-right" />

<IconButton iconClassName="muidocs-icon-custom-github" tooltip="top-center" tooltipPosition = "top-center" />

<IconButton iconClassName="muidocs-icon-custom-github" tooltip="top-left" tooltipPosition = "top-left" />
<IconButton iconClassName="muidocs-icon-custom-github" tooltip="bottom-right"
tooltipPosition="bottom-right" />
<IconButton iconClassName="muidocs-icon-custom-github" tooltip="bottom-center"
tooltipPosition="bottom-center" />
<IconButton iconClassName="muidocs-icon-custom-github" tooltip="bottom-left"
tooltipPosition="bottom-left" />
<IconButton iconClassName="muidocs-icon-custom-github" tooltip="top-right"
tooltipPosition="top-right" />
<IconButton iconClassName="muidocs-icon-custom-github" tooltip="top-center"
tooltipPosition="top-center" />
<IconButton iconClassName="muidocs-icon-custom-github" tooltip="top-left"
tooltipPosition="top-left" />
<br/><br/><br/><br/>

<IconButton tooltip="bottom-right" touch={true} tooltipPosition="bottom-right">
Expand Down
Loading

0 comments on commit dc73f45

Please sign in to comment.