-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Ensure that JSHint is done after preprocessors. #1221
Conversation
JSHint will not attempt to read/process `*.coffee` files for example. Would also be an issue when using sweet-js macros (as they may appear to be invalid).
LGTM |
Ensure that JSHint is done after preprocessors.
@gf3 - Are you saying that the generated |
@rjackson Yes, those errors are from the js generated from our coffee files. |
The I'm not sure about the |
Which leaves only 2 errors from your screenshot, and I'm unsure if |
@rjackson |
@rjackson Regardless, IMHO it would much more valuable to not run jshint over any sort of generated files and rely on different/more specialized linters. A la coffeelint. |
@gf3 I disagree as some of our preprocessors would actually break JSHint if we don't run them first (many SweetJS macros result in invalid JS code before preprocessing). Essentially, your code was not previously being JSHint'ed (as your var app = new EmberApp({
hinting: false
}); I do think that we should make the hinting pluggable though, and will add that to my list of addon enabling things once my broccoli perf refactorings are done. |
@rjackson Part of the issue is that I'd still like to use JSHint in a couple places in the project—I don't want to turn it off altogether. I can imagine others being in a similar situation, too. Additionally, specialized linters can provide more useful and context-sensitive information; things JSHint would not even be aware of. |
Seeing the same thing here re: JSHint complaining about the coffeescript compiler :'( |
Don't JSHint generated files. |
@rjackson +1for pluggable linters, though I see 3 conflicting possible desired behaviors outside of the scope of the addon.
I've been fine with just turning it off entirely as everything in my project is CS, but I'm curious what @gf3's use case is. And also if anyone can think of a reason to run compiled CS through JSHint, because I can't. |
@WMeldon Indeed, even in the case of something like SweetJS, it almost makes more sense to me to be able to make JSHint aware of the syntax of your macros vs. linting the compiled JS. As you could run into similar issues as other compilers. |
this fills me with the quiet rage of a thousand disapproving grandmothers. Having lint errors tied to code that's not directly under your control essentially makes the linting useless - maybe we need two lint-levels? |
proposed solution: don't use coffee-script or disable the linter I see a path where coffee-script is an ember-cli-addon, that brings its own linter. Unfortunately that will have to be a community effort. We will help to ensure our add-on system is sufficient to cover this case. |
Since it causes an issue for non-js either way, then I think the hinting should go back to being done pre-compile. Like @vladikoff said, hinting isn't for generated/compiled files. |
+1 for supporting disabling the linter for now. It's a nice add-on, but we'd probably take coffee-script support over it atm. EDIT: In case this isn't clear - I mean +1 for supporting the ability for the end user to disable the linter - not removing it frmo the project itself. |
@jdjkelly - The linter is currently disableable:
|
@rjackson you're amazing |
@jdjkelly ok, now I have to run and get a tasty snack.... |
JSHint currently does not work for JS that needs to be preprocessed. Specifically, this affects CoffeeScript users and folks that use custom sweet-js macros.
Also, removed left over commented out references to validateES6.