Config Key: end_with_semicolon
Description: Insert a semicolon at the end of statements
Available since version: 0.7.0 (Current: )
Type: boolean
Default: false
Support
Languages: JSX, JavaScript, TypeScript
Beautifiers: Prettier, ESLint
Comparison Table
Examples
Invisible characters are shown with the following symbols:
Carriage Return = ␍; Line Feed = ␊; Tab = ⇥; Whitespace = ·.
🚧 Original Code
var·str1·=·"Unibeautify"␊
var·str2·=·"Unibeautify";␊
var·method1·=·function()·{␊
····console.log(str1)␊
}␊
var·method2·=·function()·{␊
····console.log(str2);␊
};␊
method1()␊
method2();
🔧 true
Using Prettier beautifier:
var·str1·=·"Unibeautify";␊
var·str2·=·"Unibeautify";␊
var·method1·=·function()·{␊
··console.log(str1);␊
};␊
var·method2·=·function()·{␊
··console.log(str2);␊
};␊
method1();␊
method2();␊
How to configure
A .unibeautify.json
file would look like the following:
{
"JSX": {
"indent_size": 2,
"indent_char": " ",
"end_with_semicolon": true,
"beautifiers": [
"Prettier"
]
}
}
Difference from original
@@ -1,10 +1,10 @@
-var·str1·=·"Unibeautify"␊
+var·str1·=·"Unibeautify";␊
var·str2·=·"Unibeautify";␊
var·method1·=·function()·{␊
-····console.log(str1)␊
-}␊
+··console.log(str1);␊
+};␊
var·method2·=·function()·{␊
-····console.log(str2);␊
\ No newline at end of file
+··console.log(str2);␊
};␊
-method1()␊
-method2();
+method1();␊
+method2();␊
🔧 false
Using Prettier beautifier:
var·str1·=·"Unibeautify"␊
var·str2·=·"Unibeautify"␊
var·method1·=·function()·{␊
··console.log(str1)␊
}␊
var·method2·=·function()·{␊
··console.log(str2)␊
}␊
method1()␊
method2()␊
How to configure
A .unibeautify.json
file would look like the following:
{
"JSX": {
"indent_size": 2,
"indent_char": " ",
"end_with_semicolon": false,
"beautifiers": [
"Prettier"
]
}
}
Difference from original
@@ -1,10 +1,10 @@
var·str1·=·"Unibeautify"␊
-var·str2·=·"Unibeautify";␊
+var·str2·=·"Unibeautify"␊
var·method1·=·function()·{␊
-····console.log(str1)␊
+··console.log(str1)␊
}␊
var·method2·=·function()·{␊
-····console.log(str2);␊
-};␊
\ No newline at end of file
+··console.log(str2)␊
+}␊
method1()␊
-method2();
+method2()␊
🚧 Original Code
var·str1·=·"Unibeautify"␊
var·str2·=·"Unibeautify";␊
var·method1·=·function()·{␊
····console.log(str1)␊
}␊
var·method2·=·function()·{␊
····console.log(str2);␊
};␊
method1()␊
method2();
🔧 true
Using Prettier beautifier:
var·str1·=·"Unibeautify";␊
var·str2·=·"Unibeautify";␊
var·method1·=·function()·{␊
··console.log(str1);␊
};␊
var·method2·=·function()·{␊
··console.log(str2);␊
};␊
method1();␊
method2();␊
How to configure
A .unibeautify.json
file would look like the following:
{
"JavaScript": {
"indent_size": 2,
"indent_char": " ",
"end_with_semicolon": true,
"beautifiers": [
"Prettier"
]
}
}
Difference from original
@@ -1,10 +1,10 @@
-var·str1·=·"Unibeautify"␊
+var·str1·=·"Unibeautify";␊
var·str2·=·"Unibeautify";␊
var·method1·=·function()·{␊
-····console.log(str1)␊
-}␊
+··console.log(str1);␊
+};␊
var·method2·=·function()·{␊
-····console.log(str2);␊
\ No newline at end of file
+··console.log(str2);␊
};␊
-method1()␊
-method2();
+method1();␊
+method2();␊
🔧 false
Using Prettier beautifier:
var·str1·=·"Unibeautify"␊
var·str2·=·"Unibeautify"␊
var·method1·=·function()·{␊
··console.log(str1)␊
}␊
var·method2·=·function()·{␊
··console.log(str2)␊
}␊
method1()␊
method2()␊
How to configure
A .unibeautify.json
file would look like the following:
{
"JavaScript": {
"indent_size": 2,
"indent_char": " ",
"end_with_semicolon": false,
"beautifiers": [
"Prettier"
]
}
}
Difference from original
@@ -1,10 +1,10 @@
var·str1·=·"Unibeautify"␊
-var·str2·=·"Unibeautify";␊
+var·str2·=·"Unibeautify"␊
var·method1·=·function()·{␊
-····console.log(str1)␊
+··console.log(str1)␊
}␊
var·method2·=·function()·{␊
-····console.log(str2);␊
-};␊
\ No newline at end of file
+··console.log(str2)␊
+}␊
method1()␊
-method2();
+method2()␊
🚧 Original Code
var·str1·=·"Unibeautify"␊
var·str2·=·"Unibeautify";␊
var·method1·=·function()·{␊
····console.log(str1)␊
}␊
var·method2·=·function()·{␊
····console.log(str2);␊
};␊
method1()␊
method2();
🔧 true
Using Prettier beautifier:
var·str1·=·"Unibeautify";␊
var·str2·=·"Unibeautify";␊
var·method1·=·function()·{␊
··console.log(str1);␊
};␊
var·method2·=·function()·{␊
··console.log(str2);␊
};␊
method1();␊
method2();␊
How to configure
A .unibeautify.json
file would look like the following:
{
"TypeScript": {
"indent_size": 2,
"indent_char": " ",
"end_with_semicolon": true,
"beautifiers": [
"Prettier"
]
}
}
Difference from original
@@ -1,10 +1,10 @@
-var·str1·=·"Unibeautify"␊
+var·str1·=·"Unibeautify";␊
var·str2·=·"Unibeautify";␊
var·method1·=·function()·{␊
-····console.log(str1)␊
-}␊
+··console.log(str1);␊
+};␊
var·method2·=·function()·{␊
-····console.log(str2);␊
\ No newline at end of file
+··console.log(str2);␊
};␊
-method1()␊
-method2();
+method1();␊
+method2();␊
🔧 false
Using Prettier beautifier:
var·str1·=·"Unibeautify"␊
var·str2·=·"Unibeautify"␊
var·method1·=·function()·{␊
··console.log(str1)␊
}␊
var·method2·=·function()·{␊
··console.log(str2)␊
}␊
method1()␊
method2()␊
How to configure
A .unibeautify.json
file would look like the following:
{
"TypeScript": {
"indent_size": 2,
"indent_char": " ",
"end_with_semicolon": false,
"beautifiers": [
"Prettier"
]
}
}
Difference from original
@@ -1,10 +1,10 @@
var·str1·=·"Unibeautify"␊
-var·str2·=·"Unibeautify";␊
+var·str2·=·"Unibeautify"␊
var·method1·=·function()·{␊
-····console.log(str1)␊
+··console.log(str1)␊
}␊
var·method2·=·function()·{␊
-····console.log(str2);␊
-};␊
\ No newline at end of file
+··console.log(str2)␊
+}␊
method1()␊
-method2();
+method2()␊