Skip to content

Commit 4e89c3c

Browse files
author
Ives van Hoorne
committed
Reomve dangling commas from webpack config
1 parent b1457c9 commit 4e89c3c

File tree

3 files changed

+48
-44
lines changed

3 files changed

+48
-44
lines changed

config/webpack.config.js

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ const getOutput = () =>
3131
path: paths.appBuild,
3232
pathinfo: true,
3333
filename: 'static/js/[name].js',
34-
publicPath: '/',
34+
publicPath: '/'
3535
}
3636
: {
3737
path: paths.appBuild,
3838
pathinfo: true,
3939
filename: 'static/js/[name].[hash:8].js',
4040
chunkFilename: 'static/js/[name].[hash:8].chunk.js',
4141
sourceMapFilename: '[file].map', // Default
42-
publicPath: 'https://codesandbox.io/',
42+
publicPath: 'https://codesandbox.io/'
4343
};
4444

4545
const config = {
@@ -50,13 +50,13 @@ const config = {
5050
sandbox: [
5151
require.resolve('babel-polyfill'),
5252
require.resolve('./polyfills'),
53-
path.join(paths.sandboxSrc, 'index.js'),
53+
path.join(paths.sandboxSrc, 'index.js')
5454
],
5555
embed: [
5656
require.resolve('./polyfills'),
57-
path.join(paths.embedSrc, 'index.js'),
57+
path.join(paths.embedSrc, 'index.js')
5858
],
59-
vendor: ['codemirror', 'react', 'react-dom', 'styled-components'],
59+
vendor: ['codemirror', 'react', 'react-dom', 'styled-components']
6060
},
6161

6262
target: 'web',
@@ -70,7 +70,7 @@ const config = {
7070
include: paths.src,
7171
exclude: [/eslint\.js$/],
7272
loader: 'babel-loader',
73-
options: babelConfig,
73+
options: babelConfig
7474
},
7575
// Used to remove strict mode from eval:
7676
{
@@ -81,16 +81,16 @@ const config = {
8181
const altererdConfig = Object.assign({}, babelConfig);
8282

8383
altererdConfig.plugins.push(
84-
require.resolve('babel-plugin-transform-remove-strict-mode'),
84+
require.resolve('babel-plugin-transform-remove-strict-mode')
8585
);
8686
return altererdConfig;
87-
})(),
87+
})()
8888
},
8989
// JSON is not enabled by default in Webpack but both Node and Browserify
9090
// allow it implicitly so we also enable it.
9191
{
9292
test: /\.json$/,
93-
loader: 'json-loader',
93+
loader: 'json-loader'
9494
},
9595
// "postcss" loader applies autoprefixer to our CSS.
9696
// "css" loader resolves paths in CSS and adds assets as dependencies.
@@ -99,12 +99,12 @@ const config = {
9999
// in development "style" loader enables hot editing of CSS.
100100
{
101101
test: /\.css$/,
102-
loaders: ['style-loader', 'css-loader'],
102+
loaders: ['style-loader', 'css-loader']
103103
},
104104
// For importing README.md
105105
{
106106
test: /\.md$/,
107-
loader: 'raw-loader',
107+
loader: 'raw-loader'
108108
},
109109
// "file" loader makes sure those assets get served by WebpackDevServer.
110110
// When you `import` an asset, you get its (virtual) filename.
@@ -114,17 +114,17 @@ const config = {
114114
exclude: /\/favicon.ico$/,
115115
loader: 'file-loader',
116116
options: {
117-
name: 'static/media/[name].[hash:8].[ext]',
118-
},
117+
name: 'static/media/[name].[hash:8].[ext]'
118+
}
119119
},
120120
// A special case for favicon.ico to place it into build root directory.
121121
{
122122
test: /\/favicon.ico$/,
123123
include: [paths.src],
124124
loader: 'file-loader',
125125
options: {
126-
name: 'favicon.ico?[hash:8]',
127-
},
126+
name: 'favicon.ico?[hash:8]'
127+
}
128128
},
129129
// "url" loader works just like "file" loader but it also embeds
130130
// assets smaller than specified size as data URLs to avoid requests.
@@ -133,19 +133,19 @@ const config = {
133133
loader: 'url-loader',
134134
options: {
135135
limit: 10000,
136-
name: 'static/media/[name].[hash:8].[ext]',
137-
},
136+
name: 'static/media/[name].[hash:8].[ext]'
137+
}
138138
},
139139
// "html" loader is used to process template page (index.html) to resolve
140140
// resources linked with <link href="./relative/path"> HTML tags.
141141
{
142142
test: /\.html$/,
143143
loader: 'html-loader',
144144
options: {
145-
attrs: ['link:href'],
146-
},
147-
},
148-
],
145+
attrs: ['link:href']
146+
}
147+
}
148+
]
149149
},
150150
resolve: {
151151
mainFields: ['browser', 'module', 'jsnext:main', 'main'],
@@ -154,8 +154,8 @@ const config = {
154154
extensions: ['.js', '.json'],
155155

156156
alias: {
157-
moment: 'moment/moment.js',
158-
},
157+
moment: 'moment/moment.js'
158+
}
159159
},
160160

161161
plugins: [
@@ -175,8 +175,8 @@ const config = {
175175
keepClosingSlash: true,
176176
minifyJS: true,
177177
minifyCSS: true,
178-
minifyURLs: true,
179-
},
178+
minifyURLs: true
179+
}
180180
}),
181181
new HtmlWebpackPlugin({
182182
inject: true,
@@ -193,8 +193,8 @@ const config = {
193193
keepClosingSlash: true,
194194
minifyJS: true,
195195
minifyCSS: true,
196-
minifyURLs: true,
197-
},
196+
minifyURLs: true
197+
}
198198
}),
199199
new HtmlWebpackPlugin({
200200
inject: true,
@@ -211,8 +211,8 @@ const config = {
211211
keepClosingSlash: true,
212212
minifyJS: true,
213213
minifyCSS: true,
214-
minifyURLs: true,
215-
},
214+
minifyURLs: true
215+
}
216216
}),
217217
// Makes some environment variables available to the JS code, for example:
218218
// if (process.env.NODE_ENV === 'development') { ... }. See `env.js`.
@@ -230,26 +230,26 @@ const config = {
230230
// Try to dedupe duplicated modules, if any:
231231
new webpack.optimize.CommonsChunkPlugin({
232232
name: 'common',
233-
chunks: ['app', 'sandbox'],
233+
chunks: ['app', 'sandbox']
234234
}),
235235
new webpack.optimize.CommonsChunkPlugin({
236236
name: 'vendor',
237-
minChunks: Infinity,
237+
minChunks: Infinity
238238
}),
239239
new webpack.optimize.CommonsChunkPlugin({
240240
async: true,
241241
children: true,
242-
minChunks: 4,
242+
minChunks: 4
243243
}),
244-
new webpack.NamedModulesPlugin(),
245-
],
244+
new webpack.NamedModulesPlugin()
245+
]
246246
};
247247

248248
if (__DEV__) {
249249
const devEntries = [
250250
'react-hot-loader/patch',
251251
'webpack-dev-server/client?/',
252-
'webpack/hot/only-dev-server',
252+
'webpack/hot/only-dev-server'
253253
];
254254

255255
config.entry.app = [...devEntries, ...config.entry.app];
@@ -262,7 +262,7 @@ if (__PROD__) {
262262
// Minify the code.
263263
new webpack.LoaderOptionsPlugin({
264264
minimize: true,
265-
debug: false,
265+
debug: false
266266
}),
267267
// new BabiliPlugin(),
268268
new webpack.optimize.UglifyJsPlugin({
@@ -277,18 +277,18 @@ if (__PROD__) {
277277
dead_code: true,
278278
evaluate: true,
279279
if_return: true,
280-
join_vars: true,
280+
join_vars: true
281281
},
282282
output: {
283-
comments: false,
283+
comments: false
284284
},
285-
sourceMap: true,
286-
}),
285+
sourceMap: true
286+
})
287287
];
288288
} else {
289289
config.plugins = [
290290
...config.plugins,
291-
new webpack.HotModuleReplacementPlugin(),
291+
new webpack.HotModuleReplacementPlugin()
292292
];
293293
}
294294

src/app/containers/Modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class ModalContainer extends React.PureComponent {
124124
<Modal
125125
isOpen={modal.open}
126126
onRequestClose={this.closeModal}
127-
contentLabel={modal.title}
127+
contentLabel={modal.title || 'Modal'}
128128
style={this.getStyles(modal.width, modal.top)}
129129
closeTimeoutMS={CLOSE_TIMEOUT_MS}
130130
>

src/app/pages/Sandbox/Editor/Content/Header/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ const Left = styled.div`
5151
height: 100%;
5252
`;
5353

54-
const Chevron = styled(ChevronLeft)`
54+
const Chevron = styled.div`
55+
svg {
5556
transition: 0.3s ease all;
5657
font-size: 1.5rem;
5758
display: flex;
@@ -69,6 +70,7 @@ const Chevron = styled(ChevronLeft)`
6970
}
7071
7172
transform: rotateZ(${props => (props.workspaceHidden ? '180deg' : '0')});
73+
}
7274
`;
7375

7476
type Props = {
@@ -157,7 +159,9 @@ export default class Header extends React.PureComponent {
157159
<Chevron
158160
workspaceHidden={workspaceHidden}
159161
onClick={toggleWorkspace}
160-
/>
162+
>
163+
<ChevronLeft />
164+
</Chevron>
161165
</Tooltip>
162166
{user.jwt &&
163167
(sandbox.userLiked

0 commit comments

Comments
 (0)