-
Notifications
You must be signed in to change notification settings - Fork 401
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
Hound does not respect tests/.jshintrc #889
Comments
I think this is a great request, @elwayman02. I wouldn't mind trying my hand at implementing this as an enhancement if others closer to the project think it'd be a good idea. |
I don't think this is likely to happen soon. Hound only knows about files that are included in the pull request or referenced in .hound.yml. In order to fully support this feature of JSHint, it would either:
All that said, I do think this would be a great feature to support and would like to see it work. Is there another way I missed? |
I don't think it gets much simpler than specifying a linters name and it's config file(s). Those are literally the only options you should need, really. |
That is, I think #3 is necessary but not the evil you think it is. |
+1 for a feature like this. Currently no way of linting test files correctly. Listing multiple |
Taking a quick peek at the code: js files are in fact linted one by one. Once could extend RepoConfig#for to also take a target file name and return the linter config from the "closest" config file if multiple are registered. That would mimic the "directory walking" behavior of linters while still only depending on explicitly named config files in the repository. |
I don't see why your test code should other linting rules to it than your application code. |
@teoljungberg I've explained why in the OP. Often test code uses globals that do not (or should not) exist in app code. For example, many projects using QUnit utilize globals such as |
@elwayman02 I don't agree. Your test code should follow the same principles as your application code. If your test-code uses globals, they should be refactored away. But, then again - I've never used |
All of these frameworks use globals to define the DSL. There is not good way of refactoring away |
If there are multiple config files for a given file path, does JSHint merge them or pick the closest? Edit:
Are y'all actively maintaining two separate, complete config files for production and test code? Also note, this feature is documented under the CLI section, which Hound does not use. Any support for this feature would be a recreation of it within Hound. |
@thorncp Yes, most projects I have seen that use JSHint have |
I've closed my prior ticket (which is the same issue, different reasons) and putting in my two cents here (copied from the other ticket): Relevant comment 1: ESLint mentions that config files can have hierarchy and cascade. http://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy This doesn't appear to work at all with Hound. Is there a reason this doesn't work? Relevant comment 2: Node projects [are a use case where different config files are needed for different folders]. Don't enable, for example, Thanks. (Closed ticket: #1210.) |
There hasn't been any movement on this, and most of JS community seems to be using ESLint now. I'm going to close this. |
My comment was about ESLint which also requires/supports hierarchical config files. Should I reopen the original ESLint ticket for that (#1210)? Also, I don't know what you mean by "no movement" on this. Do you mean no movement by the Hound developers? As I understand it, it's out of the community's control, unless there's something I'm missing. I was waiting on your development team to (hopefully) work on it, so hearing it closed as "no movement" is disheartening and makes it sound like what you really mean is that the Hound/thoughtbot developers are just not planning on implementing this important feature. If you don't plan on developing it for those reasons, please help us understand so we can make a more informed decision on whether to continue using hound or not based on this feature. Thanks. |
I mean by both the developers and no additional comments on this in almost a year (thus assuming it's not a pressing issue). I've re-read the comments again (and #1210) and it seems this is something we could/should support.
Not entirely. This is an open source project. I think it makes sense to re-open this issue. |
Personally, I've just given up on using Hound at this point. Issues like this are hard blockers to even consider it. |
Currently Hound only supports a single JSHint config, even though standard usage in most products is to provide a different
.jshintrc
for tests than what's used for app code. This allows developers to declare globals that SHOULD throw warnings in app code (such as test framework methods) while ignoring them inside of tests. As far as I can tell, there is no way to configure Hound to respect the test config.The text was updated successfully, but these errors were encountered: