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

Tabs? #37

Closed
dperrymorrow opened this issue Dec 7, 2015 · 6 comments
Closed

Tabs? #37

dperrymorrow opened this issue Dec 7, 2015 · 6 comments

Comments

@dperrymorrow
Copy link
Collaborator

so is this project's code style tabs? I see that the bliss.js file has tabs instead of spaces. @LeaVerou should all code follow this convention?

Any other conventions we should be aware of?
One possibility to make sure everyone adheres to your conventions is to add a lint / hint runner to Karma.

for example: adding https://www.npmjs.com/package/karma-jshint-preprocessor to the test runner with a .jshint file enforcing the rules.

@zdfs
Copy link
Collaborator

zdfs commented Dec 7, 2015

It's tabs. http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/

I think a linter would be a good idea.

@LeaVerou
Copy link
Owner

LeaVerou commented Dec 7, 2015

The problem with linters is that often they enforce rigid code style conventions over one’s good judgement. For example, I prefer double quotes over single quotes, but use single quotes if typing a string literal that contains double quotes, as I find that more readable than escaping the quotes. A linter would not allow this kind of flexibility. Readability should always trump any code style rule.
Also, the code style is tabs for indentation, spaces for alignment, so that anyone can set the indent size at whatever they want and still have things lined up if they need to be lined up. All automated code style tools I’ve seen seem to choke on that and complain about mixing tabs and spaces, which I consider a bug of theirs (I’m certainly not the only person to use that code style).

@zdfs
Copy link
Collaborator

zdfs commented Dec 7, 2015

I guess we can close this out then?

@LeaVerou
Copy link
Owner

LeaVerou commented Dec 7, 2015

Guess so. In any case, I’m open to any linter that doesn’t have the aforementioned issues. I’m not against linters in general, I’m against overly opinionated tools. :)

@LeaVerou LeaVerou closed this as completed Dec 7, 2015
@dperrymorrow
Copy link
Collaborator Author

cool, thanks for explanation, I usually use spaces but I don't feel strongly either way. Didn't mean to come across sounding that way.

most linters can be customized, to turn off things like linting indentation, and quote style.
for example https://github.com/dperrymorrow/moment/blob/develop/Gruntfile.js#L66

If i could make a linter accept the style bliss.js is currently written in would you be open to linting as part of the test run?

@dperrymorrow dperrymorrow mentioned this issue Dec 9, 2015
@LeaVerou
Copy link
Owner

LeaVerou commented Dec 9, 2015

Yes, especially if it was customizable so I could turn off rules in the future if they turned out to be more hassle than they’re worth :)

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

No branches or pull requests

3 participants