* Add UserPreferences for semicolons
* Prototype formatter semicolon removal
* Implement semicolon insertion
* Fix existing tests
* Start adding tests
* Fix some edge cases of semicolon deletion
* Fix semicolon removal before comments
* Fix indentation
* Test on checker
* Replace semicolon-omitting writer with formatter preference
* Fix writing new nodes, update protocol
* Rename option
* Really fix formatting synthetic nodes
* Fix refactoring misses
* Un-update submodules gahhhh
* Update APIs
* Update for ESLint
* Revert accidental test change
* De-kludge deduplication of EOF processing
* Omit last element semicolon from single-line object-like types
* Revert "Omit last element semicolon from single-line object-like types"
This reverts commit 5625cb0237
.
* Fix straggler test
* Add test for leading semicolon class members
* Rename a lot of stuff for clarity
* Invert some boolean logic
77 lines
No EOL
959 B
TypeScript
77 lines
No EOL
959 B
TypeScript
/// <reference path="fourslash.ts" />
|
|
|
|
////; (function f() { })();
|
|
////const a = 3;
|
|
////+ 4;
|
|
////const b = 3
|
|
////+ 4;
|
|
////const c = 3 +
|
|
////4;
|
|
////class C {
|
|
//// prop;
|
|
//// ["p"];
|
|
//// zero: void;
|
|
//// ["one"] = {};
|
|
//// ["two"];
|
|
//// ;
|
|
////}
|
|
////a;
|
|
////`b`;
|
|
////b;
|
|
////(3);
|
|
////4;
|
|
//// / regex /;
|
|
////;
|
|
////[];
|
|
/////** blah */[0];
|
|
////interface I {
|
|
//// new;
|
|
//// ();
|
|
//// foo;
|
|
//// ();
|
|
////}
|
|
////type T = {
|
|
//// new;
|
|
//// ();
|
|
//// foo;
|
|
//// ();
|
|
////}
|
|
|
|
format.setFormatOptions({ ...format.copyFormatOptions(), semicolons: ts.SemicolonPreference.Remove });
|
|
format.document();
|
|
verify.currentFileContentIs(`; (function f() { })()
|
|
const a = 3;
|
|
+ 4
|
|
const b = 3
|
|
+ 4
|
|
const c = 3 +
|
|
4
|
|
class C {
|
|
prop
|
|
["p"]
|
|
zero: void
|
|
["one"] = {};
|
|
["two"];
|
|
;
|
|
}
|
|
a;
|
|
\`b\`
|
|
b;
|
|
(3)
|
|
4;
|
|
/ regex /;
|
|
;
|
|
[];
|
|
/** blah */[0]
|
|
interface I {
|
|
new;
|
|
()
|
|
foo;
|
|
()
|
|
}
|
|
type T = {
|
|
new;
|
|
()
|
|
foo;
|
|
()
|
|
}`); |