Skip to content

Commit fbb57b1

Browse files
style: prettier default (#220)
1 parent 5e3bb95 commit fbb57b1

40 files changed

+604
-605
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
root: true,
3-
extends: ['@webpack-contrib/eslint-config-webpack', 'prettier'],
3+
extends: ["@webpack-contrib/eslint-config-webpack", "prettier"],
44
};

.prettierrc.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Then add the plugin to your `webpack` config. For example:
2929
**webpack.config.js**
3030

3131
```js
32-
const CompressionPlugin = require('compression-webpack-plugin');
32+
const CompressionPlugin = require("compression-webpack-plugin");
3333

3434
module.exports = {
3535
plugins: [new CompressionPlugin()],
@@ -129,7 +129,7 @@ The algorithm is taken from [zlib](https://nodejs.org/api/zlib.html).
129129
module.exports = {
130130
plugins: [
131131
new CompressionPlugin({
132-
algorithm: 'gzip',
132+
algorithm: "gzip",
133133
}),
134134
],
135135
};
@@ -259,7 +259,7 @@ For example we have `assets/images/image.png?foo=bar#hash`:
259259
module.exports = {
260260
plugins: [
261261
new CompressionPlugin({
262-
filename: '[path][base].gz',
262+
filename: "[path][base].gz",
263263
}),
264264
],
265265
};
@@ -277,10 +277,10 @@ module.exports = {
277277
// The `pathData` argument contains all placeholders - `path`/`name`/`ext`/etc
278278
// Available properties described above, for the `String` notation
279279
if (/\.svg$/.test(pathData.file)) {
280-
return 'assets/svg/[path][base].gz';
280+
return "assets/svg/[path][base].gz";
281281
}
282282

283-
return 'assets/js/[path][base].gz';
283+
return "assets/js/[path][base].gz";
284284
},
285285
}),
286286
],
@@ -355,7 +355,7 @@ Enable file caching and set path to cache directory.
355355
module.exports = {
356356
plugins: [
357357
new CompressionPlugin({
358-
cache: 'path/to/cache',
358+
cache: "path/to/cache",
359359
}),
360360
],
361361
};
@@ -378,7 +378,7 @@ $ npm install @gfx/zopfli --save-dev
378378
**webpack.config.js**
379379

380380
```js
381-
const zopfli = require('@gfx/zopfli');
381+
const zopfli = require("@gfx/zopfli");
382382

383383
module.exports = {
384384
plugins: [
@@ -405,13 +405,13 @@ We can take advantage of this built-in support for Brotli in Node 10.16.0 and la
405405
**webpack.config.js**
406406

407407
```js
408-
const zlib = require('zlib');
408+
const zlib = require("zlib");
409409

410410
module.exports = {
411411
plugins: [
412412
new CompressionPlugin({
413-
filename: '[path][base].br',
414-
algorithm: 'brotliCompress',
413+
filename: "[path][base].br",
414+
algorithm: "brotliCompress",
415415
test: /\.(js|css|html|svg)$/,
416416
compressionOptions: {
417417
params: {
@@ -434,20 +434,20 @@ You can find all Brotli’s options in [the relevant part of the zlib module doc
434434
**webpack.config.js**
435435

436436
```js
437-
const zlib = require('zlib');
437+
const zlib = require("zlib");
438438

439439
module.exports = {
440440
plugins: [
441441
new CompressionPlugin({
442-
filename: '[path][base].gz',
443-
algorithm: 'gzip',
442+
filename: "[path][base].gz",
443+
algorithm: "gzip",
444444
test: /\.js$|\.css$|\.html$/,
445445
threshold: 10240,
446446
minRatio: 0.8,
447447
}),
448448
new CompressionPlugin({
449-
filename: '[path][base].br',
450-
algorithm: 'brotliCompress',
449+
filename: "[path][base].br",
450+
algorithm: "brotliCompress",
451451
test: /\.(js|css|html|svg)$/,
452452
compressionOptions: {
453453
params: {

babel.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ module.exports = (api) => {
77
return {
88
presets: [
99
[
10-
'@babel/preset-env',
10+
"@babel/preset-env",
1111
{
1212
targets: {
13-
node: '10.13.0',
13+
node: "10.13.0",
1414
},
1515
},
1616
],

commitlint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
extends: ['@commitlint/config-conventional'],
2+
extends: ["@commitlint/config-conventional"],
33
};

husky.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
hooks: {
3-
'pre-commit': 'lint-staged',
4-
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
3+
"pre-commit": "lint-staged",
4+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
55
},
66
};

jest.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
2-
testEnvironment: 'node',
3-
snapshotResolver: './test/helpers/snapshotResolver.js',
2+
testEnvironment: "node",
3+
snapshotResolver: "./test/helpers/snapshotResolver.js",
44
};

lint-staged.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
2-
'*.js': ['prettier --write', 'eslint --fix'],
3-
'*.{json,md,yml,css,ts}': ['prettier --write'],
2+
"*.js": ["eslint --fix", "prettier --write"],
3+
"*.{json,md,yml,css,ts}": ["prettier --write"],
44
};

src/Webpack4Cache.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import os from 'os';
1+
import os from "os";
22

3-
import cacache from 'cacache';
4-
import findCacheDir from 'find-cache-dir';
5-
import serialize from 'serialize-javascript';
3+
import cacache from "cacache";
4+
import findCacheDir from "find-cache-dir";
5+
import serialize from "serialize-javascript";
66

77
export default class Webpack4Cache {
88
constructor(compilation, options, weakCache) {
@@ -14,7 +14,7 @@ export default class Webpack4Cache {
1414
}
1515

1616
static getCacheDirectory() {
17-
return findCacheDir({ name: 'compression-webpack-plugin' }) || os.tmpdir();
17+
return findCacheDir({ name: "compression-webpack-plugin" }) || os.tmpdir();
1818
}
1919

2020
async get(cacheData, { RawSource }) {

src/Webpack5Cache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default class Cache {
22
constructor(compilation) {
3-
this.cache = compilation.getCache('CompressionWebpackPlugin');
3+
this.cache = compilation.getCache("CompressionWebpackPlugin");
44
}
55

66
async get(cacheData) {

0 commit comments

Comments
 (0)