Config Key: space_after_anon_function
Description: Add a space before an anonymous function's parentheses. ie. function ()
Available since version: 0.7.0 (Current: )
Type: boolean
Default: false
Support
Languages: EJS, JSX, JavaScript, Riot, Swig, Twig, TypeScript
Beautifiers: JS-Beautify, Pretty Diff, ESLint
Comparison Table
Examples
Invisible characters are shown with the following symbols:
Carriage Return = ␍; Line Feed = ␊; Tab = ⇥; Whitespace = ·.
No example found. Please submit a Pull Request!
🚧 Original Code
const·anonymousFunc1·=·function·(arg1)·{}␊
const·anonymousFunc2·=·function(arg1)·{}␊
const·anonymousFunc3·=·function(arg1,·arg2)·{}␊
const·anonymousFunc4·=·function(arg1,arg2)·{}␊
const·anonymousFunc5·=·function(·arg1,·arg2·)·{}␊
const·anonymousFunc6·=·function()·{}␊
function·namedFunc1·(arg1)·{}␊
function·namedFunc2(arg1)·{}␊
function·namedFunc3(arg1,·arg2)·{}␊
function·namedFunc4(arg1,arg2)·{}␊
function·namedFunc5(·arg1,·arg2·)·{}␊
function·namedFunc6()·{}␊
🔧 true
Using JS-Beautify beautifier:
const·anonymousFunc1·=·function·(arg1)·{}␊
const·anonymousFunc2·=·function·(arg1)·{}␊
const·anonymousFunc3·=·function·(arg1,·arg2)·{}␊
const·anonymousFunc4·=·function·(arg1,·arg2)·{}␊
const·anonymousFunc5·=·function·(arg1,·arg2)·{}␊
const·anonymousFunc6·=·function·()·{}␊
␊
function·namedFunc1(arg1)·{}␊
␊
function·namedFunc2(arg1)·{}␊
␊
function·namedFunc3(arg1,·arg2)·{}␊
␊
function·namedFunc4(arg1,·arg2)·{}␊
␊
function·namedFunc5(arg1,·arg2)·{}␊
␊
function·namedFunc6()·{}
How to configure
A .unibeautify.json
file would look like the following:
{
"JSX": {
"indent_size": 2,
"indent_char": " ",
"space_after_anon_function": true,
"beautifiers": [
"JS-Beautify"
]
}
}
Difference from original
@@ -1,12 +1,18 @@
const·anonymousFunc1·=·function·(arg1)·{}␊
-const·anonymousFunc2·=·function(arg1)·{}␊
-const·anonymousFunc3·=·function(arg1,·arg2)·{}␊
-const·anonymousFunc4·=·function(arg1,arg2)·{}␊
-const·anonymousFunc5·=·function(·arg1,·arg2·)·{}␊
-const·anonymousFunc6·=·function()·{}␊
-function·namedFunc1·(arg1)·{}␊
+const·anonymousFunc2·=·function·(arg1)·{}␊
+const·anonymousFunc3·=·function·(arg1,·arg2)·{}␊
+const·anonymousFunc4·=·function·(arg1,·arg2)·{}␊
+const·anonymousFunc5·=·function·(arg1,·arg2)·{}␊
+const·anonymousFunc6·=·function·()·{}␊
+␊
+function·namedFunc1(arg1)·{}␊
+␊
function·namedFunc2(arg1)·{}␊
+␊
function·namedFunc3(arg1,·arg2)·{}␊
-function·namedFunc4(arg1,arg2)·{}␊
-function·namedFunc5(·arg1,·arg2·)·{}␊
-function·namedFunc6()·{}␊
+␊
+function·namedFunc4(arg1,·arg2)·{}␊
+␊
+function·namedFunc5(arg1,·arg2)·{}␊
+␊
+function·namedFunc6()·{}
\ No newline at end of file
🔧 false
Using JS-Beautify beautifier:
const·anonymousFunc1·=·function(arg1)·{}␊
const·anonymousFunc2·=·function(arg1)·{}␊
const·anonymousFunc3·=·function(arg1,·arg2)·{}␊
const·anonymousFunc4·=·function(arg1,·arg2)·{}␊
const·anonymousFunc5·=·function(arg1,·arg2)·{}␊
const·anonymousFunc6·=·function()·{}␊
␊
function·namedFunc1(arg1)·{}␊
␊
function·namedFunc2(arg1)·{}␊
␊
function·namedFunc3(arg1,·arg2)·{}␊
␊
function·namedFunc4(arg1,·arg2)·{}␊
␊
function·namedFunc5(arg1,·arg2)·{}␊
␊
function·namedFunc6()·{}
How to configure
A .unibeautify.json
file would look like the following:
{
"JSX": {
"indent_size": 2,
"indent_char": " ",
"space_after_anon_function": false,
"beautifiers": [
"JS-Beautify"
]
}
}
Difference from original
@@ -1,12 +1,18 @@
-const·anonymousFunc1·=·function·(arg1)·{}␊
+const·anonymousFunc1·=·function(arg1)·{}␊
const·anonymousFunc2·=·function(arg1)·{}␊
const·anonymousFunc3·=·function(arg1,·arg2)·{}␊
-const·anonymousFunc4·=·function(arg1,arg2)·{}␊
-const·anonymousFunc5·=·function(·arg1,·arg2·)·{}␊
+const·anonymousFunc4·=·function(arg1,·arg2)·{}␊
+const·anonymousFunc5·=·function(arg1,·arg2)·{}␊
const·anonymousFunc6·=·function()·{}␊
-function·namedFunc1·(arg1)·{}␊
+␊
+function·namedFunc1(arg1)·{}␊
+␊
function·namedFunc2(arg1)·{}␊
+␊
function·namedFunc3(arg1,·arg2)·{}␊
-function·namedFunc4(arg1,arg2)·{}␊
-function·namedFunc5(·arg1,·arg2·)·{}␊
-function·namedFunc6()·{}␊
+␊
+function·namedFunc4(arg1,·arg2)·{}␊
+␊
+function·namedFunc5(arg1,·arg2)·{}␊
+␊
+function·namedFunc6()·{}
\ No newline at end of file
🚧 Original Code
const·anonymousFunc1·=·function·(arg1)·{}␊
const·anonymousFunc2·=·function(arg1)·{}␊
const·anonymousFunc3·=·function(arg1,·arg2)·{}␊
const·anonymousFunc4·=·function(arg1,arg2)·{}␊
const·anonymousFunc5·=·function(·arg1,·arg2·)·{}␊
const·anonymousFunc6·=·function()·{}␊
function·namedFunc1·(arg1)·{}␊
function·namedFunc2(arg1)·{}␊
function·namedFunc3(arg1,·arg2)·{}␊
function·namedFunc4(arg1,arg2)·{}␊
function·namedFunc5(·arg1,·arg2·)·{}␊
function·namedFunc6()·{}␊
🔧 true
Using JS-Beautify beautifier:
const·anonymousFunc1·=·function·(arg1)·{}␊
const·anonymousFunc2·=·function·(arg1)·{}␊
const·anonymousFunc3·=·function·(arg1,·arg2)·{}␊
const·anonymousFunc4·=·function·(arg1,·arg2)·{}␊
const·anonymousFunc5·=·function·(arg1,·arg2)·{}␊
const·anonymousFunc6·=·function·()·{}␊
␊
function·namedFunc1(arg1)·{}␊
␊
function·namedFunc2(arg1)·{}␊
␊
function·namedFunc3(arg1,·arg2)·{}␊
␊
function·namedFunc4(arg1,·arg2)·{}␊
␊
function·namedFunc5(arg1,·arg2)·{}␊
␊
function·namedFunc6()·{}
How to configure
A .unibeautify.json
file would look like the following:
{
"JavaScript": {
"indent_size": 2,
"indent_char": " ",
"space_after_anon_function": true,
"beautifiers": [
"JS-Beautify"
]
}
}
Difference from original
@@ -1,12 +1,18 @@
const·anonymousFunc1·=·function·(arg1)·{}␊
-const·anonymousFunc2·=·function(arg1)·{}␊
-const·anonymousFunc3·=·function(arg1,·arg2)·{}␊
-const·anonymousFunc4·=·function(arg1,arg2)·{}␊
-const·anonymousFunc5·=·function(·arg1,·arg2·)·{}␊
-const·anonymousFunc6·=·function()·{}␊
-function·namedFunc1·(arg1)·{}␊
+const·anonymousFunc2·=·function·(arg1)·{}␊
+const·anonymousFunc3·=·function·(arg1,·arg2)·{}␊
+const·anonymousFunc4·=·function·(arg1,·arg2)·{}␊
+const·anonymousFunc5·=·function·(arg1,·arg2)·{}␊
+const·anonymousFunc6·=·function·()·{}␊
+␊
+function·namedFunc1(arg1)·{}␊
+␊
function·namedFunc2(arg1)·{}␊
+␊
function·namedFunc3(arg1,·arg2)·{}␊
-function·namedFunc4(arg1,arg2)·{}␊
-function·namedFunc5(·arg1,·arg2·)·{}␊
-function·namedFunc6()·{}␊
+␊
+function·namedFunc4(arg1,·arg2)·{}␊
+␊
+function·namedFunc5(arg1,·arg2)·{}␊
+␊
+function·namedFunc6()·{}
\ No newline at end of file
🔧 false
Using JS-Beautify beautifier:
const·anonymousFunc1·=·function(arg1)·{}␊
const·anonymousFunc2·=·function(arg1)·{}␊
const·anonymousFunc3·=·function(arg1,·arg2)·{}␊
const·anonymousFunc4·=·function(arg1,·arg2)·{}␊
const·anonymousFunc5·=·function(arg1,·arg2)·{}␊
const·anonymousFunc6·=·function()·{}␊
␊
function·namedFunc1(arg1)·{}␊
␊
function·namedFunc2(arg1)·{}␊
␊
function·namedFunc3(arg1,·arg2)·{}␊
␊
function·namedFunc4(arg1,·arg2)·{}␊
␊
function·namedFunc5(arg1,·arg2)·{}␊
␊
function·namedFunc6()·{}
How to configure
A .unibeautify.json
file would look like the following:
{
"JavaScript": {
"indent_size": 2,
"indent_char": " ",
"space_after_anon_function": false,
"beautifiers": [
"JS-Beautify"
]
}
}
Difference from original
@@ -1,12 +1,18 @@
-const·anonymousFunc1·=·function·(arg1)·{}␊
+const·anonymousFunc1·=·function(arg1)·{}␊
const·anonymousFunc2·=·function(arg1)·{}␊
const·anonymousFunc3·=·function(arg1,·arg2)·{}␊
-const·anonymousFunc4·=·function(arg1,arg2)·{}␊
-const·anonymousFunc5·=·function(·arg1,·arg2·)·{}␊
+const·anonymousFunc4·=·function(arg1,·arg2)·{}␊
+const·anonymousFunc5·=·function(arg1,·arg2)·{}␊
const·anonymousFunc6·=·function()·{}␊
-function·namedFunc1·(arg1)·{}␊
+␊
+function·namedFunc1(arg1)·{}␊
+␊
function·namedFunc2(arg1)·{}␊
+␊
function·namedFunc3(arg1,·arg2)·{}␊
-function·namedFunc4(arg1,arg2)·{}␊
-function·namedFunc5(·arg1,·arg2·)·{}␊
-function·namedFunc6()·{}␊
+␊
+function·namedFunc4(arg1,·arg2)·{}␊
+␊
+function·namedFunc5(arg1,·arg2)·{}␊
+␊
+function·namedFunc6()·{}
\ No newline at end of file
No example found. Please submit a Pull Request!
No example found. Please submit a Pull Request!
No example found. Please submit a Pull Request!
🚧 Original Code
const·anonymousFunc1·=·function·(arg1)·{}␊
const·anonymousFunc2·=·function(arg1)·{}␊
const·anonymousFunc3·=·function(arg1,·arg2)·{}␊
const·anonymousFunc4·=·function(arg1,arg2)·{}␊
const·anonymousFunc5·=·function(·arg1,·arg2·)·{}␊
const·anonymousFunc6·=·function()·{}␊
function·namedFunc1·(arg1)·{}␊
function·namedFunc2(arg1)·{}␊
function·namedFunc3(arg1,·arg2)·{}␊
function·namedFunc4(arg1,arg2)·{}␊
function·namedFunc5(·arg1,·arg2·)·{}␊
function·namedFunc6()·{}␊
🔧 true
Using Pretty Diff beautifier:
const·anonymousFunc1·=·function·(arg1)·{}␊
const·anonymousFunc2·=·function·(arg1)·{}␊
const·anonymousFunc3·=·function·(arg1,·arg2)·{}␊
const·anonymousFunc4·=·function·(arg1,·arg2)·{}␊
const·anonymousFunc5·=·function·(arg1,·arg2)·{}␊
const·anonymousFunc6·=·function·()·{}␊
function·namedFunc1(arg1)·{}␊
function·namedFunc2(arg1)·{}␊
function·namedFunc3(arg1,·arg2)·{}␊
function·namedFunc4(arg1,·arg2)·{}␊
function·namedFunc5(arg1,·arg2)·{}␊
function·namedFunc6()·{}
How to configure
A .unibeautify.json
file would look like the following:
{
"TypeScript": {
"indent_size": 2,
"indent_char": " ",
"space_after_anon_function": true,
"beautifiers": [
"Pretty Diff"
]
}
}
Difference from original
@@ -1,12 +1,12 @@
const·anonymousFunc1·=·function·(arg1)·{}␊
-const·anonymousFunc2·=·function(arg1)·{}␊
-const·anonymousFunc3·=·function(arg1,·arg2)·{}␊
-const·anonymousFunc4·=·function(arg1,arg2)·{}␊
-const·anonymousFunc5·=·function(·arg1,·arg2·)·{}␊
-const·anonymousFunc6·=·function()·{}␊
-function·namedFunc1·(arg1)·{}␊
+const·anonymousFunc2·=·function·(arg1)·{}␊
+const·anonymousFunc3·=·function·(arg1,·arg2)·{}␊
+const·anonymousFunc4·=·function·(arg1,·arg2)·{}␊
+const·anonymousFunc5·=·function·(arg1,·arg2)·{}␊
+const·anonymousFunc6·=·function·()·{}␊
+function·namedFunc1(arg1)·{}␊
function·namedFunc2(arg1)·{}␊
function·namedFunc3(arg1,·arg2)·{}␊
-function·namedFunc4(arg1,arg2)·{}␊
-function·namedFunc5(·arg1,·arg2·)·{}␊
-function·namedFunc6()·{}␊
+function·namedFunc4(arg1,·arg2)·{}␊
+function·namedFunc5(arg1,·arg2)·{}␊
+function·namedFunc6()·{}
\ No newline at end of file
🔧 false
Using Pretty Diff beautifier:
const·anonymousFunc1·=·function(arg1)·{}␊
const·anonymousFunc2·=·function(arg1)·{}␊
const·anonymousFunc3·=·function(arg1,·arg2)·{}␊
const·anonymousFunc4·=·function(arg1,·arg2)·{}␊
const·anonymousFunc5·=·function(arg1,·arg2)·{}␊
const·anonymousFunc6·=·function()·{}␊
function·namedFunc1(arg1)·{}␊
function·namedFunc2(arg1)·{}␊
function·namedFunc3(arg1,·arg2)·{}␊
function·namedFunc4(arg1,·arg2)·{}␊
function·namedFunc5(arg1,·arg2)·{}␊
function·namedFunc6()·{}
How to configure
A .unibeautify.json
file would look like the following:
{
"TypeScript": {
"indent_size": 2,
"indent_char": " ",
"space_after_anon_function": false,
"beautifiers": [
"Pretty Diff"
]
}
}
Difference from original
@@ -1,12 +1,12 @@
-const·anonymousFunc1·=·function·(arg1)·{}␊
+const·anonymousFunc1·=·function(arg1)·{}␊
const·anonymousFunc2·=·function(arg1)·{}␊
const·anonymousFunc3·=·function(arg1,·arg2)·{}␊
-const·anonymousFunc4·=·function(arg1,arg2)·{}␊
-const·anonymousFunc5·=·function(·arg1,·arg2·)·{}␊
+const·anonymousFunc4·=·function(arg1,·arg2)·{}␊
+const·anonymousFunc5·=·function(arg1,·arg2)·{}␊
const·anonymousFunc6·=·function()·{}␊
-function·namedFunc1·(arg1)·{}␊
+function·namedFunc1(arg1)·{}␊
function·namedFunc2(arg1)·{}␊
function·namedFunc3(arg1,·arg2)·{}␊
-function·namedFunc4(arg1,arg2)·{}␊
-function·namedFunc5(·arg1,·arg2·)·{}␊
-function·namedFunc6()·{}␊
+function·namedFunc4(arg1,·arg2)·{}␊
+function·namedFunc5(arg1,·arg2)·{}␊
+function·namedFunc6()·{}
\ No newline at end of file