jonom / jquery-focuspoint

jQuery plugin for 'responsive cropping'. Dynamically crop images to fill available space without cutting out the image's subject. Great for full-screen images.
Other
3.15k stars 211 forks source link

coding style #32

Closed g-van-vreckem closed 8 years ago

g-van-vreckem commented 9 years ago

http://contribute.jquery.org/style-guide/js/ Added the .jshintrc, ran jshint... Being in compliance will not be a nice patch.

jonom commented 9 years ago

Planning to do some refactoring for 1.2 and will make use of this style guide then

g-van-vreckem commented 9 years ago

Remark,

The jQuery .jshintrc is out tune with the last jshint (2.5.6) I adapted it so: Removed the deprecated:

    "smarttabs": true,
    "trailing": true,

Added:

    "browser": true,
    "jquery": true,

I added the file to the pending pull-request Unfortunately, I discovered that jshint meant to be community driven and friendly looks more and more like the dogmatic jslint they froked from and in fact isn't helping much adhering to a project specific style. The last batch of feature removal make it mostly ignore indentation and spacing issues and even onevar is totally buggy and fail to notify on most of the extraneous one.

A promising replacement to jshint is https://github.com/jscs-dev/node-jscs but I'm not sure it's ready yet.

Note: the guard ; need to be put on the same line as the ( like this ;( function to pass validation.