-
-
Notifications
You must be signed in to change notification settings - Fork 109
feat: add include and exclude options (options.include|options.exclude)
#82
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
Conversation
michael-ciniawsky
left a comment
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.
👍 Very nice
| this.compressionOptions = {}; | ||
|
|
||
| if (typeof this.algorithm === 'string') { | ||
| // eslint-disable-next-line global-require |
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.
Please always move eslint-disable stuff to the top of the particular file :)
/* eslint-disable
* global-require,
* more rules...,
*/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.
@michael-ciniawsky i think it is bad practice because disable rule on all file can provoke errors in places where I would not want to ignore them. Disabled rule should be on line (before line) where i want disable, not on all file.
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.
@evilebottnawi You can also leave them it's not a critical issue by any means, but I would still argue that while you are right for things like eval no-eval should occur where the code is, styling related stuff should be at the top (if needed) to lessen the noise while reading the code. These comments shouldn't be necessary at all normally... :)
| compiler.plugin('emit', (compilation, callback) => { | ||
| const assets = compilation.assets; | ||
| const { assets } = compilation; | ||
| // eslint-disable-next-line consistent-return |
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.
See previous comment :)
src/index.js
Outdated
| delete assets[file]; | ||
| } | ||
| cb(); | ||
| return cb(); |
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.
cb();
return null;?
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.
exclude and include optionsinclude and exclude options (options.include|options.exclude)
acff2b7 to
6269e9d
Compare
michael-ciniawsky
left a comment
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.
If nobody objects within the next 48 hours I will merge this PR or someone else merges it in the meantime :)
| this.compressionOptions = {}; | ||
|
|
||
| if (typeof this.algorithm === 'string') { | ||
| // eslint-disable-next-line global-require |
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.
@evilebottnawi You can also leave them it's not a critical issue by any means, but I would still argue that while you are right for things like eval no-eval should occur where the code is, styling related stuff should be at the top (if needed) to lessen the noise while reading the code. These comments shouldn't be necessary at all normally... :)
| if (this.deleteOriginalAssets) { | ||
| delete assets[file]; | ||
| } | ||
| cb(); |
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.
\ncb()\n
6269e9d to
f9feda1
Compare
|
@michael-ciniawsky also add newlines before/after |
Notable ChangesAdd an
include&&excludeoption forassetsIssuesoptions.exclude) #81Also fix
eslintproblems and fix typo('`') in documentation