-
-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: apply webpack-defaults #54
Conversation
src/index.js
Outdated
this.algorithm = options.algorithm || 'gzip'; | ||
this.filename = options.filename || false; | ||
this.compressionOptions = {}; | ||
if (typeof this.algorithm === 'string') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use more newlines before ifs but maybe that's just me. 👍
src/index.js
Outdated
} else { | ||
const zlib = require('zlib'); | ||
this.algorithm = zlib[this.algorithm]; | ||
if (!this.algorithm) throw new Error('Algorithm not found in zlib'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is another case I would rather force by linting. if (...) {}
always as it bites too easily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newlines between logical/lexical blocks is 👍 imho. Better more then none in general 😛
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bebraw - last i checked we do enforce if (...) {}
with the latest version of the eslint preset.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@d3viant0ne Ok, great. 👍
package.json
Outdated
"main": "dist/cjs.js", | ||
"files": [ | ||
"dist" | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"repository": {
"type": "git",
"url": "git+https://github.com/webpack-contrib/compression-webpack-plugin.git"
},
"bugs": {
"url": "https://github.com/webpack-contrib/compression-webpack-plugin/issues"
},
"homepage": "https://webpack.js.org",
Need to fix a few things in the pacakge.json / readme before this merges. |
|
It's a local branch, if you want to throw your repo standards changes in here go nuts. |
Intended to be merged before & released with #26 & #45 as a part of
1.0.0
on a betadist-tag
once this has been finished and properly tested.This is as close to inline with the defaults eslint config as this is going to get without making non-trivial structural changes to the lib which isn't something we should really be doing without a proper set of validations.
Closes #52