Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

Commit

Permalink
enforce spaces in objects, arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
bdefore committed Jan 22, 2016
1 parent 94b2556 commit 45a2dba
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
"no-console": 0,
"no-alert": 0,
"no-nested-ternary": 0,
"max-len": 0
"max-len": 0,
"object-curly-spacing": [2, "always"],
"array-bracket-spacing": [2, "always"]
},
"plugins": [
"react",
Expand Down
8 changes: 4 additions & 4 deletions bin/merge-babel-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ module.exports = (userBabelConfig, verbose) => {
transforms: [
{
transform: 'react-transform-hmr',
imports: ['react'],
locals: ['module']
imports: [ 'react' ],
locals: [ 'module' ]
},
{
transform: 'react-transform-catch-errors',
imports: ['react', 'redbox-react']
imports: [ 'react', 'redbox-react' ]
}
]
}
Expand All @@ -31,7 +31,7 @@ module.exports = (userBabelConfig, verbose) => {
babelConfig.cacheDirectory = true;

const babelLoader = 'babel-loader?' + JSON.stringify(babelConfig);
const jsLoaders = [babelLoader];
const jsLoaders = [ babelLoader ];

// output configuration files if user wants verbosity
if (verbose) {
Expand Down
2 changes: 1 addition & 1 deletion config/webpack-isomorphic-tools.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {
parser: WebpackIsomorphicToolsPlugin.url_loader_parser
},
style_modules: {
extensions: ['css', 'less', 'scss'],
extensions: [ 'css', 'less', 'scss' ],
filter: (module, regex, options, log) => {
if (options.development) {
// in development mode there's webpack "style-loader",
Expand Down
4 changes: 2 additions & 2 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module.exports = {
'src',
'node_modules'
],
extensions: ['', '.json', '.js', '.jsx']
extensions: [ '', '.json', '.js', '.jsx' ]
},
resolveLoader: {
modulesDirectories: [
Expand Down Expand Up @@ -127,7 +127,7 @@ module.exports = {
}
}),
new webpack.optimize.CommonsChunkPlugin({
names: ['vendor'],
names: [ 'vendor' ],
minChunks: Infinity
})
]
Expand Down
10 changes: 5 additions & 5 deletions src/server/body.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';
import ReactDOM from 'react-dom/server';
import serialize from 'serialize-javascript';

Expand All @@ -12,14 +12,14 @@ export default class Body extends Component {
};

render() {
const {assets, component, store} = this.props;
const { assets, component, store } = this.props;
const content = component ? ReactDOM.renderToString(component) : '';

return (
<body>
<div id="content" dangerouslySetInnerHTML={{__html: content}}/>
<script dangerouslySetInnerHTML={{__html: `window.__data=${serialize(store.getState())};`}} charSet="UTF-8"/>
{Object.keys(assets.javascript).map((jsAsset, key) =>
<div id="content" dangerouslySetInnerHTML={{ __html: content }}/>
<script dangerouslySetInnerHTML={{ __html: `window.__data=${serialize(store.getState())};` }} charSet="UTF-8"/>
{ Object.keys(assets.javascript).map((jsAsset, key) =>
<script src={assets.javascript[jsAsset]} key={key} charSet="UTF-8"/>
)}
</body>
Expand Down
4 changes: 2 additions & 2 deletions src/server/head.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path';
import React, {Component, PropTypes} from 'react';
import React, { Component, PropTypes } from 'react';
import DocumentMeta from 'react-document-meta';

export default class Head extends Component {
Expand All @@ -19,7 +19,7 @@ export default class Head extends Component {
}

render() {
const {assets} = this.props;
const { assets } = this.props;

return (
<head>
Expand Down
2 changes: 1 addition & 1 deletion src/shared/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { map } from 'lodash';
import createLogger from 'redux-logger';
import { syncHistory } from 'redux-simple-router';

import { compose as composeDevtools, listenToRouter as linkDevtoolsToRouter} from '../client/devtools';
import { compose as composeDevtools, listenToRouter as linkDevtoolsToRouter } from '../client/devtools';
import { applyMiddleware, createStore } from 'redux';

// explicit path required for HMR to function. see #7
Expand Down

0 comments on commit 45a2dba

Please sign in to comment.