mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
added rule to insert space after let\const in variable declaration context
This commit is contained in:
22
tests/cases/fourslash/formattingInDestructuring1.ts
Normal file
22
tests/cases/fourslash/formattingInDestructuring1.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////interface let { }
|
||||
/////*1*/var x: let [];
|
||||
////
|
||||
////function foo() {
|
||||
//// 'use strict'
|
||||
/////*2*/ let [x] = [];
|
||||
/////*3*/ const [x] = [];
|
||||
/////*4*/ for (let[x] = [];x < 1;) {
|
||||
//// }
|
||||
////}
|
||||
|
||||
format.document();
|
||||
goTo.marker("1");
|
||||
verify.currentLineContentIs("var x: let[];");
|
||||
goTo.marker("2");
|
||||
verify.currentLineContentIs(" let [x] = [];");
|
||||
goTo.marker("3");
|
||||
verify.currentLineContentIs(" const [x] = [];");
|
||||
goTo.marker("4");
|
||||
verify.currentLineContentIs(" for (let [x] = []; x < 1;) {");
|
||||
Reference in New Issue
Block a user