Refactor | Move the code into different functions - #291
Conversation
Avoid mutate the options parameter. https://eslint.org/docs/rules/no-param-reassign.html
Avoid use of chained assignment expressions https://eslint.org/docs/rules/no-multi-assign
It is only called in getName
There was a problem hiding this comment.
I read through these changes – they look good to me!
There's more that can be improved here, I think, though refactorings are sometimes easier to read if code is moved "as is" (as was done here) and then improved later.
Tests are failing; haven't dug through to see if it's related to this change.
@paulmelnikow Yes, there are other things that can be improved. |
ForsakenHarmony
commented
Jan 2, 2019
yeah, tests are unrelated I think, just stupidity on uglify's part |
* Calc the extension and save it in a const to make the code simpler
ForsakenHarmony
commented
Jan 3, 2019
Feel free to update the snapshots |
* Before pkgName was equal to undefined * Allow passing no-pkg and no-pkg-name tests
I can't update the snapshots, because the tests are working on my machine 😱 Probably its something related to the dependencies. Update: And now are broken, I don't know why. |
Andarist
commented
Jan 4, 2019
Maybe you have to clean npm cache and try to reinstall? If that won't help I'll look into it. |
ForsakenHarmony
commented
Jan 4, 2019
remove |
I did what you said. For some reason, the tests are creating new folders with the TS declaration files ( |
ForsakenHarmony
commented
Jan 4, 2019
that's very weird |
ForsakenHarmony
commented
Jan 10, 2019
bors r+ |
Build succeeded |
| entries: options.entries, | ||
| cwd, | ||
| source: options.pkg.source, | ||
| module: options.pkg.module, |
There was a problem hiding this comment.
I’m curious to learn, unless this is a mistake; how is module used as an input here?
Issue #289