Skip to content

Eslint #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"env": {
"node": true,
"browser": true,
"es6": true,
"commonjs": true
},
"extends": "eslint:recommended",
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react",
"babel"
],
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"no-unused-vars": "warn"
}
}
3 changes: 2 additions & 1 deletion devServer.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint no-console: 0 */
var path = require('path');
var express = require('express');
var webpack = require('webpack');
Expand Down Expand Up @@ -28,4 +29,4 @@ app.listen(5000, 'localhost', function(err) {
}

console.log('Listening at http://localhost:5000/example');
});
});
66 changes: 33 additions & 33 deletions example/container.js
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
import React, { Component } from 'react'
import {Nav, NavItem} from 'react-bootstrap'
import React, { Component } from 'react';
import {Nav, NavItem} from 'react-bootstrap';

export default class ContainerExample extends Component {
constructor(props) {
super(props)
}
constructor(props) {
super(props);
}

render() {
render() {

const route = this.props.routes[1].path || 'container'
const route = this.props.routes[1].path || 'container';

return (
<div>
<nav className="navbar navbar-default navbar-fixed-top">
<div className="container">
<div className="navbar-header">
<a className="navbar-brand" href="/example">
React-d3 core
</a>
</div>
</div>
</nav>
<div style={{marginTop: '50px', padding: '30px'}}>
<Nav bsStyle="pills" justified activeKey={route}>
<NavItem eventKey="container" href="/example/container">Chart Container</NavItem>
<NavItem eventKey="grid" href="/example/grid">Grid</NavItem>
<NavItem eventKey="label" href="/example/label">Label</NavItem>
<NavItem eventKey="legend" href="/example/legend">Legend</NavItem>
<NavItem eventKey="xaxis" href="/example/xaxis">Xaixs</NavItem>
<NavItem eventKey="yaxis" href="/example/yaxis">Yaixs</NavItem>
</Nav>
</div>
{this.props.children}
</div>
)
}
}
return (
<div>
<nav className="navbar navbar-default navbar-fixed-top">
<div className="container">
<div className="navbar-header">
<a className="navbar-brand" href="/example">
React-d3 core
</a>
</div>
</div>
</nav>
<div style={{marginTop: '50px', padding: '30px'}}>
<Nav bsStyle="pills" justified activeKey={route}>
<NavItem eventKey="container" href="/example/container">Chart Container</NavItem>
<NavItem eventKey="grid" href="/example/grid">Grid</NavItem>
<NavItem eventKey="label" href="/example/label">Label</NavItem>
<NavItem eventKey="legend" href="/example/legend">Legend</NavItem>
<NavItem eventKey="xaxis" href="/example/xaxis">Xaixs</NavItem>
<NavItem eventKey="yaxis" href="/example/yaxis">Yaixs</NavItem>
</Nav>
</div>
{this.props.children}
</div>
);
}
}
26 changes: 13 additions & 13 deletions example/index.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import { Router, Route, browserHistory, IndexRedirect} from 'react-router'
import Container from './container'
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, browserHistory, IndexRedirect} from 'react-router';
import Container from './container';

import {default as ChartContainer} from './src/container'
import Grid from './src/grid'
import Label from './src/label'
import Legend from './src/legend'
import Xaxis from './src/xaxis'
import Yaxis from './src/yaxis'
import {default as ChartContainer} from './src/container';
import Grid from './src/grid';
import Label from './src/label';
import Legend from './src/legend';
import Xaxis from './src/xaxis';
import Yaxis from './src/yaxis';

// Declarative route configuration (could also load this config lazily
// instead, all you really need is a single root route, you don't need to
// colocate the entire config).


ReactDOM.render((
<Router history={browserHistory}>
<Route path="/example" component={Container}>
<IndexRedirect to="container"/>
<Route path="container" component={ChartContainer}/>
<Route path="container" component={ChartContainer}/>
<Route path="grid" component={Grid}/>
<Route path="label" component={Label}/>
<Route path="legend" component={Legend}/>
<Route path="xaxis" component={Xaxis}/>
<Route path="yaxis" component={Yaxis}/>
</Route>
</Router>
), document.getElementById('root'))
), document.getElementById('root'));
Loading