Skip to content

Conversation

@treyhunner
Copy link
Contributor

This .editorconfig file defines the indentation style used in all jQuery UI JavaScript libraries.

EditorConfig is a file format for defining coding conventions in shared code bases. EditorConfig plugins are available for many popular text editors.

With this .editorconfig file present code contributors with an EditorConfig plugin installed will find adhering to the defined indentation style more natural.

As can be seen from the indentation fixes I made in #605, jQuery UI contributors sometimes mistakenly use spaces for indentation and they are not always consistent in their use of space (some use 2 spaces, some use 4 spaces, and some use 8 spaces).

Note: I co-created EditorConfig last year. We greatly appreciate feedback on the project.

@scottgonzalez
Copy link
Member

Thanks Trey. EditorConfig seems like a good idea, but doesn't seem to have much of a community around it. We're going to discuss whether we should embrace this.

@treyhunner
Copy link
Contributor Author

That is correct. EditorConfig does not yet have much of a community around it yet.

My main goal with this pull request is to spark a discussion regarding the pros and cons of adopting the format into jQuery UI.

Thanks for updating me on the status of the request.

@dmethvin
Copy link
Member

@treyhunner we couldn't come up with any cons. Do you have any? :)

@treyhunner
Copy link
Contributor Author

Behind every pro there is a con hiding somewhere :)

Some cons:

  • Obligation of maintainers to update stale .editorconfig files after major style changes
  • INI file flavor used is not universally readable by all INI readers (see this page for context)
  • Need for installing a text editor plugin to use this file in any automated way
  • Each .editorconfig file is one extra non-code file cluttering up the code base
@dmethvin
Copy link
Member

None of these seem like serious drawbacks.

Would you mind submitting a pull request to jquery/jquery as well?

@treyhunner
Copy link
Contributor Author

Yes. I will submit a pull request to jquery as well.

@scottgonzalez
Copy link
Member

Finally getting around to this :-)

@treyhunner does this seem to make the most sense?

[grunt.js] indent_style = tabs [ui/**.js] indent_style = tabs [tests/unit/**.js] indent_style = tabs 
@treyhunner
Copy link
Contributor Author

tabs needs to be tab for all three of those cases. That looks correct besides that problem.

@scottgonzalez
Copy link
Member

Thanks, landed in 0ecff6a.

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

Labels

None yet

3 participants