Skip to content

Commit 6e49237

Browse files
t-mrtmhegazy
authored andcommitted
Remove trailing whitespace from tsconfig.json (#16197)
* Remove trailing whitespace from tsconfig.json * Simplify
1 parent 928da67 commit 6e49237

File tree

9 files changed

+89
-89
lines changed

9 files changed

+89
-89
lines changed

src/compiler/commandLineParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ namespace ts {
10421042
for (let i = 0; i < nameColumn.length; i++) {
10431043
const optionName = nameColumn[i];
10441044
const description = descriptionColumn[i];
1045-
result.push(tab + tab + optionName + makePadding(marginLength - optionName.length + 2) + description);
1045+
result.push(optionName && `${tab}${tab}${optionName}${ description && (makePadding(marginLength - optionName.length + 2) + description)}`);
10461046
}
10471047
if (configurations.files && configurations.files.length) {
10481048
result.push(`${tab}},`);

tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
/* Basic Options */
3+
/* Basic Options */
44
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
55
"module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */
66
// "lib": [], /* Specify library files to be included in the compilation: */
@@ -17,36 +17,36 @@
1717
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
1818
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
1919
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
20-
21-
/* Strict Type-Checking Options */
20+
21+
/* Strict Type-Checking Options */
2222
"strict": true /* Enable all strict type-checking options. */
2323
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
2424
// "strictNullChecks": true, /* Enable strict null checks. */
2525
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
2626
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
27-
28-
/* Additional Checks */
27+
28+
/* Additional Checks */
2929
// "noUnusedLocals": true, /* Report errors on unused locals. */
3030
// "noUnusedParameters": true, /* Report errors on unused parameters. */
3131
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
3232
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
33-
34-
/* Module Resolution Options */
33+
34+
/* Module Resolution Options */
3535
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
3636
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
3737
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
3838
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
3939
// "typeRoots": [], /* List of folders to include type definitions from. */
4040
// "types": [], /* Type declaration files to be included in compilation. */
4141
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
42-
43-
/* Source Map Options */
42+
43+
/* Source Map Options */
4444
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
4545
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
4646
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
4747
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
48-
49-
/* Experimental Options */
48+
49+
/* Experimental Options */
5050
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
5151
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
5252
}

tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
/* Basic Options */
3+
/* Basic Options */
44
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
55
"module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */
66
// "lib": [], /* Specify library files to be included in the compilation: */
@@ -17,36 +17,36 @@
1717
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
1818
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
1919
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
20-
21-
/* Strict Type-Checking Options */
20+
21+
/* Strict Type-Checking Options */
2222
"strict": true, /* Enable all strict type-checking options. */
2323
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
2424
// "strictNullChecks": true, /* Enable strict null checks. */
2525
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
2626
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
27-
28-
/* Additional Checks */
27+
28+
/* Additional Checks */
2929
"noUnusedLocals": true /* Report errors on unused locals. */
3030
// "noUnusedParameters": true, /* Report errors on unused parameters. */
3131
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
3232
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
33-
34-
/* Module Resolution Options */
33+
34+
/* Module Resolution Options */
3535
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
3636
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
3737
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
3838
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
3939
// "typeRoots": [], /* List of folders to include type definitions from. */
4040
// "types": [], /* Type declaration files to be included in compilation. */
4141
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
42-
43-
/* Source Map Options */
42+
43+
/* Source Map Options */
4444
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
4545
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
4646
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
4747
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
48-
49-
/* Experimental Options */
48+
49+
/* Experimental Options */
5050
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
5151
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
5252
}

tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
/* Basic Options */
3+
/* Basic Options */
44
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
55
"module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */
66
// "lib": [], /* Specify library files to be included in the compilation: */
@@ -17,36 +17,36 @@
1717
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
1818
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
1919
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
20-
21-
/* Strict Type-Checking Options */
20+
21+
/* Strict Type-Checking Options */
2222
"strict": true /* Enable all strict type-checking options. */
2323
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
2424
// "strictNullChecks": true, /* Enable strict null checks. */
2525
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
2626
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
27-
28-
/* Additional Checks */
27+
28+
/* Additional Checks */
2929
// "noUnusedLocals": true, /* Report errors on unused locals. */
3030
// "noUnusedParameters": true, /* Report errors on unused parameters. */
3131
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
3232
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
33-
34-
/* Module Resolution Options */
33+
34+
/* Module Resolution Options */
3535
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
3636
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
3737
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
3838
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
3939
// "typeRoots": [], /* List of folders to include type definitions from. */
4040
// "types": [], /* Type declaration files to be included in compilation. */
4141
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
42-
43-
/* Source Map Options */
42+
43+
/* Source Map Options */
4444
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
4545
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
4646
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
4747
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
48-
49-
/* Experimental Options */
48+
49+
/* Experimental Options */
5050
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
5151
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
5252
}

tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
/* Basic Options */
3+
/* Basic Options */
44
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */
55
"module": "commonjs", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */
66
// "lib": [], /* Specify library files to be included in the compilation: */
@@ -17,36 +17,36 @@
1717
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
1818
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
1919
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
20-
21-
/* Strict Type-Checking Options */
20+
21+
/* Strict Type-Checking Options */
2222
"strict": true /* Enable all strict type-checking options. */
2323
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
2424
// "strictNullChecks": true, /* Enable strict null checks. */
2525
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
2626
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
27-
28-
/* Additional Checks */
27+
28+
/* Additional Checks */
2929
// "noUnusedLocals": true, /* Report errors on unused locals. */
3030
// "noUnusedParameters": true, /* Report errors on unused parameters. */
3131
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
3232
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
33-
34-
/* Module Resolution Options */
33+
34+
/* Module Resolution Options */
3535
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
3636
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
3737
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
3838
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
3939
// "typeRoots": [], /* List of folders to include type definitions from. */
4040
// "types": [], /* Type declaration files to be included in compilation. */
4141
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
42-
43-
/* Source Map Options */
42+
43+
/* Source Map Options */
4444
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
4545
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
4646
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
4747
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
48-
49-
/* Experimental Options */
48+
49+
/* Experimental Options */
5050
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
5151
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
5252
},

0 commit comments

Comments
 (0)