Is there a way to bulk format code in Sublime Text?
Asked Answered
G

2

9

Is there a plugin, or setting in Sublime Text that will enable project-level code formatting and application of the .EditorConfig plugin?

I'm wondering specifically about manual application of .editorconfig preferences re-indenting multiple, deleting trailing whitespace, converting spaces to tabs, etc., across file types. To keep it basic, I'll limit my query to HTML, CSS/LESS/SASS, and JS.

Gaberlunzie answered 5/2, 2014 at 20:1 Comment(2)
Be specific. The way your question is written it'll be closed for being too broad.Typhoid
Not sure how much more specific I can be. Can you think of details I should add?Gaberlunzie
P
3

There is no tool quite like this yet. There are some tools that almost do what you want. For example my not-yet-stable EditorConfig tools, eclint (not sure how stable this is), and codepainter (which works for JavaScript only).

An EditorConfig bulk reformatter would be great. If anyone finds one I didn't mention or wants to create a better one, you could probably find some help or moral support on the EditorConfig mailing list.

Pyrogenous answered 10/2, 2014 at 20:20 Comment(0)
S
0

Haven't used editor config before, but a quick search led me to https://github.com/sindresorhus/editorconfig-sublime. Perhaps that plugin will do what you want.

Snuffy answered 7/2, 2014 at 7:36 Comment(2)
I've got that one, but it doesn't do bulk formatting.Gaberlunzie
You can make a feature request on the github page. Although a ST plugin may not be the best approach for this. To do a bulk update, you ST would have to open, edit, and save all of the files. It may be better to look for an external tool that supports EditorConfig, that you can just run on the project directories.Snuffy

© 2022 - 2024 — McMap. All rights reserved.