-
Notifications
You must be signed in to change notification settings - Fork 91
Plugins
kewah edited this page Oct 7, 2014
·
41 revisions
JavaScript is a very flexible language, which means people write it in many different ways, since adding support for every single kind of style would be impossible, we decided to introduce plugins; that should give enough flexibility to tailor the formatting to match the craziest needs.
-
esformatter-quotes
- enforces coding style that string literals are delimited with single or double quotes.
-
rocambole-commafirst
- rewrites program following the comma-first style.
-
esformatter-braces
- enforces braces around statements.
-
esformatter-semicolons
- adds missing and removes unnecessary semicolons.
-
esformatter-dot-notation
- transform
obj['property']
intoobj.property
for valid string literals.
- transform
-
esformatter-literal-notation
- transform array and object constructors to literal notations. (example:
new Object()
=>{}
)
- transform array and object constructors to literal notations. (example:
List of plugins that we would like to see developed/maintained:
- normalize comments at the end/beginning of lines/blocks.
- keep objects and arrays into a single line if short enough.
- hard wrap lines if over a certain length.
- enforce braces in conditionals/loops/scopes
- custom indent levels for chained expression
- sort variables and properties
If you're interested in writing a plugin, check out the documentation on writing plugins.
We are also flagging any issues that could/should be implemented as a plugin with the tag plugins-wishlist