Skip to content

Added .editorconfig file #698

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

Closed
wants to merge 3 commits into from

Conversation

AurelioDeRosa
Copy link
Member

.editorconfig file taken directly from jQuery's repository.

@scottgonzalez
Copy link
Member

@agcolom
Copy link
Member

agcolom commented Feb 24, 2016

@kswedberg Could you please have a look? I'm wondering whether we need an entry for each of package.json and *.yml to be set to two spaces?

@gnarf
Copy link
Member

gnarf commented Feb 24, 2016

If that's the spacing we are using for those files (and that is the spacing that npm uses for package.json) I would agree that we should add those to the .editorconfig

@agcolom
Copy link
Member

agcolom commented Feb 24, 2016

@gnarf Thank you very much for checking. @AurelioDeRosa would you be able to add this? Thank you so much!

@kswedberg
Copy link
Member

So, based on the OP and comments above, I think it might be a bit more "DRY" to do it like this:

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab

[**.json]
indent_style = space
indent_size = 2

[.*]
indent_style = space
indent_size = 2

Thoughts, @AurelioDeRosa , @scottgonzalez , @gnarf, anyone?

@AurelioDeRosa
Copy link
Member Author

I think we can combine the second and third sections and use:

[*.{json,yml}]
indent_style = space
indent_size = 2

@scottgonzalez
Copy link
Member

I would limit to package.json and *.yml. Other .json files use tabs.

@AurelioDeRosa
Copy link
Member Author

Something like?

[{package.json,*.yml}]

@gnarf
Copy link
Member

gnarf commented Feb 24, 2016

I think it's a lot clearer to just list the stuff twice for that... no reason to like not copy/pasta two lines of indent/size settings...

[package.json]
....

[*.yml]
....

feels a lot easier to understand at a glance than using the not as well known {a,b} glob syntax

@AurelioDeRosa
Copy link
Member Author

Fine @gnarf. So I'd say that the final file should be:

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = tab

[package.json]
indent_style = space
indent_size = 2

[*.yml]
indent_style = space
indent_size = 2

If everyone is happy, I'll make a final PR and then merge.

@kswedberg
Copy link
Member

LGTM! Thanks for sticking with this, @AurelioDeRosa .

@AurelioDeRosa
Copy link
Member Author

File updated. Any further comment @gnarf and @scottgonzalez?

@gnarf
Copy link
Member

gnarf commented Feb 26, 2016

👍

@AurelioDeRosa AurelioDeRosa deleted the editorconfig branch February 26, 2016 21:45
Krinkle pushed a commit that referenced this pull request Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants