Skip to content
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

Provide config files for format and linting #336

Closed
dertseha opened this issue Oct 12, 2013 · 6 comments
Closed

Provide config files for format and linting #336

dertseha opened this issue Oct 12, 2013 · 6 comments
Milestone

Comments

@dertseha
Copy link
Contributor

It would be great to have .jsbeautifyrc and .jshintrc files for the project (Possibly an .editorconfig as well).
Apart from easier contribution, eating your own dog food is always good.

@nponiros
Copy link

Yes .jshintrc would be nice. It would suffice if each .js file had (the same) jshint options in it which is currently not the case..

Having jshint in files would have the advantage of not putting too many files in the root of the project which have nothing to do with the python code.. Of course jshintrc could also be put in the js/ folder but I find this a bit unconventional.

But the big question would be: what options to choose and who defines those..

Regarding .jsbeautifyrc: same thing about having it in the root as with jshintrc. A code snippet on how to run it before a commit would be enough for me..

@dertseha
Copy link
Contributor Author

I'd put the files into the js folder; There are two sub-projects and like you wrote, it doesn't make sense to have the settings file global even over the python code. So, from the point of view of the js sub-project, these settings would be in its 'root' folder.

As for which options to choose, my suggestion is:

  • .jsbeautifyrc: simply use the defaults. Based on the question "Why is there a default the same project doesn't even adhere to?"
  • .jshintrc: Start with defaults, trim & align with file-specific settings until a common denominator is found, then clean up sources accordingly.

Regarding the script: I'd opt for a Grunt based build with a small manually written task that runs the project on itself.

@nponiros
Copy link

Actually you could have the jshint settings in package.json. As there already is a package.json in the root there will be no overhead.

Furthermore you could use a 'script' in package.json to run jshint/jsbeautifier via npm (similar to the existing npm test command)

This would probably be the cleanest solution with no extra files and no 'special' directives in the various .js files.

For an example package.json see: https://github.com/jshint/jshint/blob/master/package.json#L51

@dertseha
Copy link
Contributor Author

Having the settings not in their respective standard files would be contrary to my motivation: I want to have these settings files in order to work with editors, such as SublimeText in my case. The corresponding plugins (jshint, jsbeautifier) look for the respective standard settings files and apply the rules.

@bitwiseman
Copy link
Member

@dertseha - This sounds like a fine idea. Please submit a pull request.

@bitwiseman bitwiseman modified the milestones: v1.5.1, v1.5.0 Apr 25, 2014
@bitwiseman
Copy link
Member

Moved this out of 1.5.0 since we're seeing no movement on it. It can wait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants