Closed Francisc closed 10 years ago
Why are you linting code after running it through pre-processors?
Well why not? :) Let's say I'm checking up on you.
Still, I want to make my code minify-able, that's why I use ngmin. I don't want it to do more or at least let me choose.
If I want to minify it, I'll use uglify.js for example.
So, is it possible to tell ngmin to just do "its job" and leave the rest for other plugins?
Unless there's a real use for this behavior, I'm not interested in implementing it. If you want to submit a PR that fixes this, be my guest.
@Francisc what is that code actually doing? im just curious
Haha, it's Brian's code and it basically checks if both template and templateUrl were specified. Here: https://github.com/btford/angular-modal/blob/master/modal.js#L14
It's kind of cryptic, but I liked the idea so I kept it.
Brian: Real use for what behaviour?
As in there's some distinct advantage to ngmin -> lint -> uglify
over the recommended lint -> ngmin -> uglify
.
If you want to verify that your code still works after ngmin
and/or uglify
, you should run a test suite on the code again. Linting is helpful for catching human-introduced errors but less helpful for catching errors introduced by preprocessors.
This behavior is a side effect of regenerating the code from an AST. The behavior of the code is the same.
grunt-contrib-jshint's README indicates it's a real use case: https://github.com/gruntjs/grunt-contrib-jshint#linting-before-and-after-concatenating
This is not such a big issue for me though. What bothers me is the fact that I would like to use ngmin to only make sure DI works and I can't.
What bothers me is the fact that I would like to use ngmin to only make sure DI works and I can't.
Is there some other issue you're alluding to?
No-no, I meant "make sure minification works with DI". As in just convert short form to long-but-safe form and don't do anything else.
ngmin does a few code minifications which aren't really useful to me. It has side effects, besides making code minification-safe.
Please try https://github.com/olov/ng-annotate. ngmin is now deprecated: https://github.com/btford/ngmin/issues/93
If your issue isn't resolved there please open an issue at https://github.com/olov/ng-annotate/issues
If you really want ngmin to fix this issue, feel free to fork it and use that.
Thanks. I gave up on ngmin because it wasn't "honest". I'll try ng-annotate for my next project.
Hello,
I have a modal service that is inspired by your implementation.
The template check looks like this in the original file:
The same looks like this in the parsed file:
That causes JSHint to throw a warning about "confusing pluses". It touches other parts of code as well.
Is there any way to ask ngmin to just makes sure DI will work and not touch other parts of the code?
Thanks.