Skip to content

Commit 7e2f0e1

Browse files
committed
fix lint errors
1 parent 1d5959d commit 7e2f0e1

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

index.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class NetlifyServerPushPlugin {
1212
this.redirects = redirects;
1313
} else {
1414
throw new TypeError(
15-
`redirects should be an array, but was of type '${typeof redirects}'`,
15+
`redirects should be an array, but was of type '${typeof redirects}'`
1616
);
1717
}
1818
}
@@ -52,9 +52,7 @@ class NetlifyServerPushPlugin {
5252
.replace(/\.chunk(\.\w+)?\.js$/, '')
5353
.replace(/\/home/, '/');
5454
const routeJs = `Link: </${filename}>; rel=preload; as=script`;
55-
headers = `${headers}\n${path}\n\t${mainCss}\n\t${mainJs}\n\t${
56-
routeJs
57-
}`;
55+
headers = `${headers}\n${path}\n\t${mainCss}\n\t${mainJs}\n\t${routeJs}`;
5856
});
5957

6058
compilation.assets._headers = {
@@ -90,7 +88,7 @@ class NetlifyServerPushPlugin {
9088
module.exports = function(config, options = {}) {
9189
if (!config || !config.plugins) {
9290
throw new Error(
93-
'You need to pass the webpack config to preact-cli-plugin-netlify!',
91+
'You need to pass the webpack config to preact-cli-plugin-netlify!'
9492
);
9593
}
9694

@@ -105,7 +103,7 @@ module.exports = function(config, options = {}) {
105103
}
106104

107105
config.plugins.push(new NetlifyServerPushPlugin(options));
108-
const plugins = config.plugins;
106+
const { plugins } = config;
109107
for (let pluginIndex = 0; pluginIndex < plugins.length; pluginIndex++) {
110108
const plugin = plugins[pluginIndex];
111109
if (plugin && plugin.options && plugin.options.cacheId) {
@@ -123,7 +121,7 @@ module.exports = function(config, options = {}) {
123121

124122
function getPluginsByName(config, name) {
125123
return getPlugins(config).filter(
126-
w => w.plugin && w.plugin.constructor && w.plugin.constructor.name === name,
124+
w => w.plugin && w.plugin.constructor && w.plugin.constructor.name === name
127125
);
128126
}
129127

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,17 @@
4747
},
4848
"lint-staged": {
4949
"*.js": [
50-
"prettier --write --single-quote --print-width=80 --trailing-comma=all",
50+
"prettier --write",
5151
"xo",
5252
"git add"
53+
],
54+
"*.json": [
55+
"prettier --write",
56+
"git add"
57+
],
58+
"**/*.md": [
59+
"prettier --write",
60+
"git add"
5361
]
5462
},
5563
"husky": {

0 commit comments

Comments
 (0)