esformatter plugin to add
semicolon before [
and (
if they are the first things on the line.
created mainly to be used by standard-format
Add to your esformatter config file:
{
"plugins": [
"esformatter-semicolon-first"
]
}
Or you can manually register the plugin if not using esformatter
directly:
// register plugin
esformatter.register(require('esformatter-semicolon-first'));
Given this input program:
var x = 2
[1,2,3].map(function() {})
var y = 8
(function() {
bar()
}())
It will output:
var x = 2
;[1,2,3].map(function() {})
var y = 8
;(function() {
bar()
}())
For more examples see the test files inside the test/
folder.
Released under the MIT License.