Skip to content

Conversation

@ntwb
Copy link
Contributor

@ntwb ntwb commented Jan 25, 2015

JSHint no longer supports onevar, smarttabs or trailing options (JSHint source here)

JSHint is moving away from purely stylistic warnings. You should use JSCS for that.

Bonus: Includes "final new line" based on .editorconfig rule 😜

JSHint no longer supports `onevar`, `smarttabs` or `trailing` options.

> JSHint is moving away from purely stylistic warnings. You should use JSCS for that.

JSHint's removed options source
https://github.com/jshint/jshint/blob/3d9c430259afbecd002ca65662ea3103cae512b8/src/options.js#L875
@arthurvr
Copy link
Member

These are indeed deprecated, but removing them would be against our style guide. We recently had a discussion about it here: jquery-archive/css-chassis@24c71e2.

@markelog
Copy link
Member

Core uses jshint 2.5, those options no longer there and jscs 1.7.3 where jquery preset have included substitutes for them.

@scottgonzalez what is the plan?

@scottgonzalez
Copy link
Member

This conversation has been had so many times in so many places that I won't even bother trying to track down the actual conversations. Here's the gist of it: We are waiting for @mikesherov to say that JSCS has implemented the right amount of checks before making this a required standard across all projects. Until then, each project is free to do what they want in order to test what works well and what doesn't (so long as their testing doesn't actually regress). Some projects ended up updating JSHint too early, which was bad because they lost the ability to enforce certain style rules. Today, it's safe to use JSCS to catch all the style-related rules that were dropped from JSHint, so it's safe to upgrade both. There is no requirement today other than being able to programmatically enforce the JSHint options listed in the style guide, even if there's a different tool doing that enforcement (such as JSCS + JSHint).

@ntwb
Copy link
Contributor Author

ntwb commented Jan 26, 2015

Thanks for the feedback everyone, greatly appreciated.

@markelog
Copy link
Member

Some projects ended up updating JSHint too early, which was bad because they lost the ability to enforce certain style rules

Core uses fixed dependency versions but it doesn't help agaisnt auto-update of jshint, since if project uses grunt-contrib-jshint it uses 2.x version, cause grunt plugin uses tilde for jshint dependency.
So removal of style related options was inevitable.

There is no requirement today other than being able to programmatically enforce the JSHint options listed in the style guide

I don't understand what is you trying to say, for example, onevar is listed as the requirement, but it is removed, it is however enforced by jscs.

You still want it in the jshint config?

even if there's a different tool doing that enforcement (such as JSCS + JSHint).

This is not mentioned in the guide, it explicitly said that jshint should do it and such config of jshint should be used.

It seems those options should be removed from jshint config and guide should be updated.

@scottgonzalez
Copy link
Member

I don't understand what is you trying to say, for example, onevar is listed as the requirement, but it is removed, it is however enforced by jscs.

You still want it in the jshint config?

No. If you're using a version of JSHint that doesn't support onevar, then it shouldn't be in the config. What matters is that something is enforcing what JSHint's previous onevar option means.

@markelog
Copy link
Member

Okay, so if understood you correctly - need to wait on guide update (although it still seems weird to have it there) and you're okay with merging this PR and creating new one for chassis?

@scottgonzalez
Copy link
Member

even if there's a different tool doing that enforcement (such as JSCS + JSHint).

This is not mentioned in the guide, it explicitly said that jshint should do it and such config of jshint should be used.

It seems those options should be removed from jshint config and guide should be updated.

Because as of today, JSCS is not a tool that's required across projects. What is required and agreed upon is a set of JSHint settings. We're aiming for common sense here rather than being super pedantic about settings and specific versions of tools. Once we're ready to standardize JSCS, it will be listed in the style guide and the JSHint config will be updated, along with the addition of the JSCS config.

@scottgonzalez
Copy link
Member

Okay, so if understood you correctly - need to wait on guide update (although it still seems weird to have it there) and you're okay with merging this PR and creating new one for chassis?

I'm not sure what you think is weird. You can merge this today, as I've already said. Please ignore Chassis right now, I don't want to get into a discussion about a dozen individual repositories. We have a standard, some projects have opted to test the future implementation by simultaneously using JSCS. Please just stick with what you're doing and when we're ready to change the standard, it will change.

@markelog
Copy link
Member

I'm not sure what you think is weird.

Guide, currently, ask you to use grunt jshint, which as of version 0.10.0 (which was released a year ago) uses jshint 2.5.x, which doesn't include those options, but guide ask you to enforce them with .jshintrc config.

Guide doesn't say use different tool if those options aren't available in jshint. Currently, guide ask you to follow instructions that are not possible to follow.

I think this is weird.

If you like, we could move this discussion to the contribute repo.

markelog pushed a commit that referenced this pull request Mar 8, 2015
(cherry-picked from 34da7d5)

JSHint no longer supports `onevar`, `smarttabs` or `trailing` options.

Closes gh-2029
@markelog markelog closed this in 34da7d5 Mar 8, 2015
@markelog
Copy link
Member

markelog commented Mar 8, 2015

Had to change two other .jshintrc before merging, nevertheless, thank you!

@ntwb
Copy link
Contributor Author

ntwb commented Mar 9, 2015

👍 Thanks @markelog

@ntwb ntwb deleted the patch-1 branch March 9, 2015 00:38
markelog pushed a commit that referenced this pull request Nov 10, 2015
JSHint no longer supports `onevar`, `smarttabs` or `trailing` options.

Closes gh-2029
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants