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

indent #201

Open
eliasmalik opened this issue Sep 21, 2016 · 17 comments
Open

indent #201

eliasmalik opened this issue Sep 21, 2016 · 17 comments

Comments

@eliasmalik
Copy link
Contributor

eliasmalik commented Sep 21, 2016

http://eslint.org/docs/rules/indent

"indent": ["error", 2]

4-space indent is reccommended by goodparts http://jslint.com/help.html but going with 2

@samhstn
Copy link
Member

samhstn commented Sep 26, 2016

I think quite a few people in our space are using a 2-space indent, my preference would be to use 2 spaces. Is there a reason to choose 4-space indent?

@SimonLab
Copy link
Member

I think I prefer 2 spaces also, 4 looks a bit too much. @eliasCodes @jrans @nelsonic what is your preference?

@jrans
Copy link
Member

jrans commented Sep 26, 2016

@SimonLab @Shouston3 2 please!

@eliasmalik
Copy link
Contributor Author

My preference is 2 as well, but do any of us have a reason?

@samhstn
Copy link
Member

samhstn commented Sep 26, 2016

@eliasCodes I find it nicer to write and easier to read

@nelsonic
Copy link
Member

@Shouston3 @SimonLab @eliasCodes @jrans (and anyone else interested...),
While I agree with DC http://jslint.com/help.html that 4-space can be easier to scan when you are reading code, I prefer 2 spaces. Given that the 4 space convention does not affect the reliability or quality of our code, I'm happy to use two spaces ...
good-parts-4-spaces

jrans added a commit that referenced this issue Sep 27, 2016
@eliasmalik eliasmalik mentioned this issue Sep 27, 2016
@howardroark
Copy link
Member

I'd like to try this out, but I do use 4 space tabs everywhere... Think I'm out of luck?

Whitespace is kind of one of those things... a "when in rome" deal. Could it be more adaptive? As in... "I see you use 4 space tabs... ill make sure that persists".

@nelsonic
Copy link
Member

@howardroark great question! We prefer 2-space in our JS code...
but in Elm we use 4-space ...
I think it really depends on the convention used in your team...

@iteles
Copy link
Member

iteles commented Nov 14, 2016

If we end up having them, this is probably the best candidate I've seen to date for custom rules: #231

@eliasmalik
Copy link
Contributor Author

@iteles I think a custom rule would be something that the eslint parser doesn't currently support. It does support indent rules, the question is whether we want to allow it to be configurable (and whether that's even possible).

@nelsonic
Copy link
Member

@eliasCodes I think that for our purposes having a customisable indent is way beyond the scope of the required functionality for goodparts but if a community member wanted to PR that feature we would accept it to make the plugin useful to others... 😉

@jrans
Copy link
Member

jrans commented Nov 14, 2016

@howardroark I think it'd be really nice to be able to write over the rules you want to ignore easily.

I suggest you just take the rules object from the node module located at rules/ and then use it as a basis for your own eslint config.

In the process you may come up with a neat way to customise the default which you can share 😄

@nelsonic
Copy link
Member

@howardroark the purpose of creating this repo was to have a standard across our projects using fewer well-defined language features so that code would look the same regardless of who wrote it.
if you need configurability/customisation please see: https://github.com/sindresorhus/xo 👍

@howardroark
Copy link
Member

Makes sense. I can just fork it anyway :) Thanks!

@Fl4m3Ph03n1x
Copy link

So, even though DC suggests 4 spaces, the project accepts 2 and there are no plans of a configuration file, correct?

To make everyone happy, could we not make it just a warning, instead of an error?

@iteles iteles reopened this Jun 29, 2017
@nelsonic
Copy link
Member

@Fl4m3Ph03n1x good question/point! We prefer 2-space, but a warning might be better than an error... however having many warnings in the console each time we make a commit (when using pre-commit hooks) will get v. noisy.

@Fl4m3Ph03n1x
Copy link

@nelsonic good point with with noise. I am all out of ideas then :P

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

8 participants