Skip to content

Commit

Permalink
linting party
Browse files Browse the repository at this point in the history
  • Loading branch information
hartym committed Apr 13, 2016
1 parent d54f8e8 commit eed56c0
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 19 deletions.
4 changes: 1 addition & 3 deletions config/webpack/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,15 @@ const defaultWebpackConfig = {

sassLoader: {
includePaths: [path.resolve(__dirname, '../node_modules')]
}
},

/*
postcss (bundler) {
return [
require('postcss-import')({ addDependencyTo: bundler }),
require('precss')(),
require('autoprefixer')({ browsers: AUTOPREFIXER_BROWSERS })
]
}
*/
}

export default defaultWebpackConfig
1 change: 0 additions & 1 deletion config/webpack/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const serverConfig = {
__dirname: false
},


plugins: [
...defaultConfig.plugins,
new webpack.DefinePlugin({ ...config, 'process.env.BROWSER': false }),
Expand Down
3 changes: 1 addition & 2 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import configureStore from './store'
// Styles.
require('./styles/index.scss')


// Configure store and browser-friendly history
const store = configureStore(browserHistory, window.__INITIAL_STATE__)
const history = syncHistoryWithStore(browserHistory, store)
Expand All @@ -34,7 +33,7 @@ const render = () => {
// Render the client side react component.
ReactDOM.render(
<Provider store={store}>
<Router history={history} routes={routes}/>
<Router history={history} routes={routes} />
</Provider>,
document.getElementById('root')
)
Expand Down
2 changes: 1 addition & 1 deletion src/example/components/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Layout extends React.Component {
<nav className="navbar navbar-fixed-top navbar-light bg-faded">
<div className="container">
<IndexLink className="navbar-brand" to="/">
<i className="fa fa-code"/>
<i className="fa fa-code" />
{' '}
LeanJS
</IndexLink>
Expand Down
2 changes: 1 addition & 1 deletion src/example/components/ReadTheDocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ReadTheDocs extends React.Component {
>
<i className="fa fa-book" />{' '}Read the docs
</a>
);
)
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/routes.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from 'react'
import { Router, Route, IndexRoute } from 'react-router'
import { Route, IndexRoute } from 'react-router'
import Layout from './example/components/Layout'
import Home from './example/components/Home'
import About from './example/components/About'

export default (
<Route path="/" component={Layout}>
<IndexRoute component={Home}/>
<Route path="about" component={About}/>
<IndexRoute component={Home} />
<Route path="about" component={About} />
</Route>
);
)

if (module.hot) {
module.hot.accept()
Expand Down
11 changes: 4 additions & 7 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import routes from './routes'
import configureStore from './store'
import morgan from 'morgan'


function renderElementWithState (store, element) {
const innerHtml = ReactDOMServer.renderToString(element)
const head = Helmet.rewind()
Expand All @@ -43,7 +42,6 @@ function renderElementWithState (store, element) {
</html>`
}


/**
* Create HTML from router props.
*/
Expand All @@ -59,8 +57,8 @@ function render (store, renderProps) {
/**
* Configure server
*/
function createHandler (handler) {
handler = handler || new Express();
function createHandler (baseHandler) {
const handler = baseHandler || new Express()

handler.use(morgan('combined'))
// Add production middlewares
Expand All @@ -77,7 +75,7 @@ function createHandler (handler) {
const store = configureStore(memoryHistory)
const history = syncHistoryWithStore(memoryHistory, store)

match({ history, routes: routes, location: req.url }, (error, redirectLocation, renderProps) => {
match({ history, routes, location: req.url }, (error, redirectLocation, renderProps) => {
if (error) {
res.status(500).send(error.message)
} else if (redirectLocation) {
Expand All @@ -93,7 +91,6 @@ function createHandler (handler) {
return handler
}


const defaultHandler = createHandler()

/**
Expand All @@ -106,7 +103,7 @@ const defaultHandler = createHandler()
*/
if (require.main === module) {
require('http').createServer(defaultHandler).listen(config.PORT, () => {
console.log('[http] Listening to :' + config.PORT);
console.log(`[http] Server listening to :${config.PORT}`) // eslint-disable-line no-console
})
}

Expand Down

0 comments on commit eed56c0

Please sign in to comment.