Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Add a default preset #268

Closed
jzaefferer opened this issue Feb 25, 2014 · 7 comments · Fixed by #282
Closed

Add a default preset #268

jzaefferer opened this issue Feb 25, 2014 · 7 comments · Fixed by #282
Labels

Comments

@jzaefferer
Copy link
Contributor

Currently jscs does nothing without explicit configuration files, which seems to me like a bad default. I suggest adding a default preset, based on the Google JavaScript style guide. Along with the existing jquery preset, jscs would cover the two most common style guides (esformatter does the same, Google is default, jQuery preset is bundled).

The only problem with this approach might be that some people don't want to use any of the default settings. For this case, you could provide a noop preset that does nothing, so if I want to have full control over the configuration, I'd use preset: "noop" and go from there.

If that seems way too crazy, keep the current noop behaviour as the default and just bundle a google preset that I can use as a sane starting point.

This somewhat duplicates #250. I don't agree with the notion of "But jscs couldn't have a default options so i'm sceptical." though, as outlined above.

@jzaefferer
Copy link
Contributor Author

Also somewhat a duplicate of #197, but I'm going a little further here, suggesting a default preset, not just a Google preset.

@jzaefferer
Copy link
Contributor Author

Also somewhat a duplicate of #109, but that sounds way too complicated. Just make the tool do something useful by default.

@markelog
Copy link
Member

Along with the existing jquery preset, jscs would cover the two most common style guides

I would very much like to have google preset, i talked with some devs about it, but so far no luck, i guess we would have to implement it ourselves, it would be nice to check out some project(s) that use jscs and google style guide, so we could start from somewhere.

I'd use preset: "noop" and go from there.

Why? You could provide empty json config, which would do the same thing.

I don't agree with the notion of "But jscs couldn't have a default options so i'm sceptical." though, as outlined above.

It's more like "doesn't have" then "couldn't have"

Google is default, jQuery preset is bundled

@mdevils what you think?

@mdevils
Copy link
Member

mdevils commented Feb 25, 2014

JSCS is not about any of style guides (unlike many other style checkers). JSCS is completely style independent and I believe it should be like that in the future. I am aiming on having a lot of little rules to match any codestyle you wish, but no default codestyles, no default presets. I would not like to promote any codestyle. Start from scratch or use a preset explicitly.

@jzaefferer
Copy link
Contributor Author

I'm fine with not having a default, while bundling both "jquery" and "google" presets. It looks to me like the .jscsrc you have in this repo could be used as a starting point for the google preset. What do you think?

By now very much a duplicate of #197.

@mdevils
Copy link
Member

mdevils commented Mar 3, 2014

Sorry, but I have no idea about Google code styles. Feel free to provide a starting point for Google preset as a pull-request.

jzaefferer added a commit to jzaefferer/node-jscs that referenced this issue Mar 3, 2014
@mikesherov mikesherov reopened this Mar 8, 2014
@jzaefferer
Copy link
Contributor Author

Why did you reopen this? If there isn't supposed to be a default preset, this can be closed.

rxin pushed a commit to rxin/node-jscs that referenced this issue Mar 8, 2014
rxin pushed a commit to rxin/node-jscs that referenced this issue Mar 8, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants