Skip to content

Commit

Permalink
fix lint errors from updating
Browse files Browse the repository at this point in the history
  • Loading branch information
levithomason committed Feb 9, 2016
1 parent 8e59c02 commit 5cd1ae6
Show file tree
Hide file tree
Showing 309 changed files with 2,163 additions and 2,176 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": [
"ta",
"ta/frontend",
"ta/frontend"
]
}
20 changes: 10 additions & 10 deletions ENV.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@
*/
const ENV = {
setTest() {
process.env.NODE_ENV = 'test';
process.env.NODE_ENV = 'test'
},
setStaging() {
process.env.NODE_ENV = 'staging';
process.env.NODE_ENV = 'staging'
},
setProduction() {
process.env.NODE_ENV = 'production';
process.env.NODE_ENV = 'production'
},
setDevelopment() {
process.env.NODE_ENV = 'development';
process.env.NODE_ENV = 'development'
},

isProduction() {
return process.env.NODE_ENV === 'production';
return process.env.NODE_ENV === 'production'
},
isTest() {
return process.env.NODE_ENV === 'test';
return process.env.NODE_ENV === 'test'
},
isStaging() {
return process.env.NODE_ENV === 'staging';
return process.env.NODE_ENV === 'staging'
},
isDevelopment() {
return process.env.NODE_ENV === 'development' || !ENV.isProduction() && !ENV.isTest() && !ENV.isStaging();
return process.env.NODE_ENV === 'development' || !ENV.isProduction() && !ENV.isTest() && !ENV.isStaging()
},
};
}

export default ENV;
export default ENV
20 changes: 10 additions & 10 deletions docs/app/Components/ComponentDoc/ComponentDescription.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import _ from 'lodash';
import React, {Component, PropTypes} from 'react';
import SEMANTIC_TYPES from 'docs/app/utils/SemanticTypes';
import STARDUST_TYPES from 'docs/app/utils/StardustTypes';
import {Segment} from 'stardust';
import _ from 'lodash'
import React, { Component, PropTypes } from 'react'
import SEMANTIC_TYPES from 'docs/app/utils/SemanticTypes'
import STARDUST_TYPES from 'docs/app/utils/StardustTypes'
import { Segment } from 'stardust'

export default class ComponentDescription extends Component {
static propTypes = {
Expand Down Expand Up @@ -36,9 +36,9 @@ export default class ComponentDescription extends Component {
};

componentWillMount() {
this.isSemanticComponent = this.props.type in SEMANTIC_TYPES;
this.isSemanticComponent = this.props.type in SEMANTIC_TYPES
if (this.isSemanticComponent) {
this.semanticDocUrl = `http://semantic-ui.com/${this.props.type}s/${this.props.parent}.html`.toLowerCase();
this.semanticDocUrl = `http://semantic-ui.com/${this.props.type}s/${this.props.parent}.html`.toLowerCase()
}
}

Expand All @@ -48,12 +48,12 @@ export default class ComponentDescription extends Component {
<i className='book icon' />
Semantic UI Docs
</a>
);
)
return (
<Segment className='basic vertical'>
<h1 className='ui header'>
{_.capitalize(this.props.name)}
<code className='sub header' style={{float: 'right'}}>
<code className='sub header' style={{ float: 'right' }}>
<a href={`https://github.com/TechnologyAdvice/stardust/blob/master/${this.props.path}`} target='_blank'>
<i className='github icon' />
{this.props.path}
Expand All @@ -63,6 +63,6 @@ export default class ComponentDescription extends Component {
<p>{this.props.description}</p>
<p>{this.isSemanticComponent && semanticDocsLink}</p>
</Segment>
);
)
}
}
16 changes: 8 additions & 8 deletions docs/app/Components/ComponentDoc/ComponentDoc.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import React, {Component, PropTypes} from 'react';
import {Segment} from 'stardust';
import React, { Component, PropTypes } from 'react'
import { Segment } from 'stardust'

import ComponentDescription from './ComponentDescription';
import ComponentExamples from './ComponentExamples';
import ComponentProps from './ComponentProps';
import getComponentDocInfo from 'docs/app/utils/getComponentDocInfo';
import ComponentDescription from './ComponentDescription'
import ComponentExamples from './ComponentExamples'
import ComponentProps from './ComponentProps'
import getComponentDocInfo from 'docs/app/utils/getComponentDocInfo'

export default class ComponentDoc extends Component {
static propTypes = {
name: PropTypes.string,
};

render() {
const doc = getComponentDocInfo(this.props.name);
const doc = getComponentDocInfo(this.props.name)

return (
<Segment id={doc.name}>
Expand All @@ -26,6 +26,6 @@ export default class ComponentDoc extends Component {
<ComponentProps props={doc.props} />
<ComponentExamples name={doc.name} />
</Segment>
);
)
}
}
45 changes: 24 additions & 21 deletions docs/app/Components/ComponentDoc/ComponentExample.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {Component, createElement, PropTypes} from 'react';
import {Grid, Column, Button} from 'stardust';
import Highlight from 'react-highlight';
import exampleContext from 'docs/app/utils/ExampleContext';
import React, { Component, createElement, PropTypes } from 'react'
import { Grid, Column, Button } from 'stardust'
import Highlight from 'react-highlight'
import exampleContext from 'docs/app/utils/ExampleContext'

/**
* Renders a `component` and the raw `code` that produced it.
Expand All @@ -15,22 +15,25 @@ export default class ComponentExample extends Component {
title: PropTypes.string,
};

state = {showCode: false};
fileContents = require(`!raw!docs/app/Examples/${this.props.examplePath}`);
component = exampleContext(`./${this.props.examplePath}.js`);
// 'elements/Button/Types/Button' => #Button-Types-Button
anchor = this.props.examplePath.split('/').slice(1).join('-');

toggleShowCode = () => {
this.setState({showCode: !this.state.showCode});
};
constructor(props, context) {
super(props, context)
this.state = { showCode: false }
this.fileContents = require(`!raw!docs/app/Examples/${props.examplePath}`)
this.component = exampleContext(`./${props.examplePath}.js`)
// 'elements/Button/Types/Button' => #Button-Types-Button
this.anchor = props.examplePath.split('/').slice(1).join('-')
}

handleMouseEnter = () => {
this.setState({showLink: true});
this.setState({ showLink: true })
};

handleMouseLeave = () => {
this.setState({showLink: false});
this.setState({ showLink: false })
};

toggleShowCode = () => {
this.setState({ showCode: !this.state.showCode })
};

render() {
Expand All @@ -40,23 +43,23 @@ export default class ComponentExample extends Component {
{this.fileContents}
</Highlight>
</Column>
);
)

const linkIconStyle = {
display: this.state.showLink ? 'inline-block' : 'none',
marginLeft: '0.25em',
};
}

const children = <Column>{this.props.children}</Column>;
const children = <Column>{this.props.children}</Column>

return (
<Grid className='one column' style={{marginBottom: '4em'}} id={this.anchor}>
<Grid className='one column' style={{ marginBottom: '4em' }} id={this.anchor}>
<Column>
<Grid>
<Column width={12}>
<h3
className='ui header'
style={{marginBottom: 0}}
style={{ marginBottom: 0 }}
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}
>
Expand All @@ -81,6 +84,6 @@ export default class ComponentExample extends Component {
</Column>
{this.state.showCode && code}
</Grid>
);
)
}
}
18 changes: 9 additions & 9 deletions docs/app/Components/ComponentDoc/ComponentExamples.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
import React, {Component, PropTypes} from 'react';
import {Segment} from 'stardust';
import exampleContext from 'docs/app/utils/ExampleContext';
import React, { Component, PropTypes } from 'react'
import { Segment } from 'stardust'
import exampleContext from 'docs/app/utils/ExampleContext'

export default class ComponentExamples extends Component {
static propTypes = {
name: PropTypes.string
name: PropTypes.string,
};

render() {
const examples = exampleContext.keys()
.filter(path => path.includes(`/${this.props.name}Examples.js`))
.map((path, i) => {
const Example = exampleContext(path);
return <Example key={i} />;
});
const Example = exampleContext(path)
return <Example key={i} />
})

const content = (
<Segment className='basic vertical'>
<h2 className='ui header'>Examples</h2>
{examples}
</Segment>
);
)

return (
<div className='stardust-examples'>
{!!examples.length && content}
</div>
);
)
}
}
44 changes: 22 additions & 22 deletions docs/app/Components/ComponentDoc/ComponentProps.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import _ from 'lodash';
import React, {Component, PropTypes} from 'react';
import {Header, Segment, Table, TableColumn} from 'stardust';
import _ from 'lodash'
import React, { Component, PropTypes } from 'react'
import { Header, Segment, Table, TableColumn } from 'stardust'

const DOCBLOCK_DESCRIPTION_DEFAULTS = {
children: 'Body of the component.',
className: 'Class names for custom styling.',
};
}

/**
* Displays a table of a Component's PropTypes.
Expand All @@ -16,40 +16,40 @@ export default class ComponentProps extends Component {
* A single Component's prop info as generated by react-docgen.
* @type {object} Props info object where keys are prop names and values are prop definitions.
*/
props: PropTypes.object
props: PropTypes.object,
};

nameRenderer(item) {
const required = item.required && <span className='ui empty mini red circular label' />;
return <code>{item.name} {required}</code>;
const required = item.required && <span className='ui empty mini red circular label' />
return <code>{item.name} {required}</code>
}

defaultValueRenderer(item) {
const defaultValue = _.get(item, 'defaultValue.value');
const defaultIsComputed = <span className='ui mini gray circular label'>computed</span>;
const defaultValue = _.get(item, 'defaultValue.value')
const defaultIsComputed = <span className='ui mini gray circular label'>computed</span>

return (
<div>
{defaultValue} {_.get(item, 'defaultValue.computed') && defaultIsComputed}
</div>
);
)
}

render() {
const propsDefinition = this.props.props;
const propsDefinition = this.props.props
const content = _.map(propsDefinition, (propConfig, propName) => {
const name = propName;
const description = _.get(propConfig, 'docBlock.description') || DOCBLOCK_DESCRIPTION_DEFAULTS[name];
const name = propName
const description = _.get(propConfig, 'docBlock.description') || DOCBLOCK_DESCRIPTION_DEFAULTS[name]

const value = _.get(propConfig, 'type.value');
let type = _.get(propConfig, 'type.name');
const value = _.get(propConfig, 'type.value')
let type = _.get(propConfig, 'type.name')
if (type === 'union') {
type = _.map(value, (val) => val.name).join('|');
type = _.map(value, (val) => val.name).join('|')
}
type = type && `{${type}}`;
type = type && `{${type}}`

const required = propConfig.required;
const defaultValue = propConfig.defaultValue;
const required = propConfig.required
const defaultValue = propConfig.defaultValue

return {
name,
Expand All @@ -58,8 +58,8 @@ export default class ComponentProps extends Component {
required,
defaultValue,
description,
};
});
}
})

return (
<Segment className='basic vertical'>
Expand All @@ -71,6 +71,6 @@ export default class ComponentProps extends Component {
<TableColumn dataKey='description' />
</Table>
</Segment>
);
)
}
}
6 changes: 3 additions & 3 deletions docs/app/Components/ComponentDoc/ExampleSection.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {Component, PropTypes} from 'react';
import React, { Component, PropTypes } from 'react'

export default class ExampleSection extends Component {
static propTypes = {
Expand All @@ -9,11 +9,11 @@ export default class ExampleSection extends Component {
render() {
return (
<div>
<h3 className='ui dividing header' style={{margin: '2em 0'}}>
<h3 className='ui dividing header' style={{ margin: '2em 0' }}>
{this.props.title}
</h3>
{this.props.children}
</div>
);
)
}
}
Loading

0 comments on commit 5cd1ae6

Please sign in to comment.