@@ -7,7 +7,6 @@ import glob = require('glob');
77import fs = require( 'fs' ) ;
88import os = require( 'os' ) ;
99import languagePlugins = require( './lib/languagePlugins.js' ) ;
10- import { getVSCodeFormattingSettings } from './lib/formatting.js' ;
1110
1211const _reset = '\x1b[0m' ;
1312const purple = ( s : string ) => '\x1b[35m' + s + _reset ;
@@ -111,7 +110,6 @@ class Project {
111110 const clack = await import ( '@clack/prompts' ) ;
112111 const processFiles = new Set < string > ( ) ;
113112 const tsconfigAndLanguages = new Map < string , string [ ] > ( ) ;
114- const formattingSettings = getFormattingSettings ( ) ;
115113 const isTTY = process . stdout . isTTY ;
116114
117115 let projects : Project [ ] = [ ] ;
@@ -391,7 +389,6 @@ class Project {
391389 project . builtConfig ! ,
392390 project . fileNames ,
393391 project . options ,
394- formattingSettings
395392 ) ;
396393 if ( ! setupSuccess ) {
397394 projects = projects . filter ( p => p !== project ) ;
@@ -420,7 +417,7 @@ class Project {
420417 }
421418 }
422419 else {
423- project . cache [ fileName ] = fileCache = [ fileStat . mtimeMs , { } , { } , false ] ;
420+ project . cache [ fileName ] = fileCache = [ fileStat . mtimeMs , { } , { } ] ;
424421 }
425422
426423 let diagnostics = await linterWorker . lint (
@@ -477,66 +474,6 @@ class Project {
477474 await startWorker ( linterWorker ) ;
478475 }
479476
480- function getFormattingSettings ( ) {
481- let formattingSettings : ReturnType < typeof getVSCodeFormattingSettings > | undefined ;
482-
483- if ( process . argv . includes ( '--vscode-settings' ) ) {
484-
485- formattingSettings = {
486- typescript : { } ,
487- javascript : { } ,
488- vue : { } ,
489- } ;
490-
491- for ( const section of [ 'typescript' , 'javascript' ] as const ) {
492- formattingSettings [ section ] = {
493- ...ts . getDefaultFormatCodeSettings ( '\n' ) ,
494- indentStyle : ts . IndentStyle . Smart ,
495- newLineCharacter : '\n' ,
496- insertSpaceAfterCommaDelimiter : true ,
497- insertSpaceAfterConstructor : false ,
498- insertSpaceAfterSemicolonInForStatements : true ,
499- insertSpaceBeforeAndAfterBinaryOperators : true ,
500- insertSpaceAfterKeywordsInControlFlowStatements : true ,
501- insertSpaceAfterFunctionKeywordForAnonymousFunctions : true ,
502- insertSpaceBeforeFunctionParenthesis : false ,
503- insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis : false ,
504- insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets : false ,
505- insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces : true ,
506- insertSpaceAfterOpeningAndBeforeClosingEmptyBraces : true ,
507- insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces : false ,
508- insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces : false ,
509- insertSpaceAfterTypeAssertion : false ,
510- placeOpenBraceOnNewLineForFunctions : false ,
511- placeOpenBraceOnNewLineForControlBlocks : false ,
512- semicolons : ts . SemicolonPreference . Ignore ,
513- } ;
514- }
515-
516- let vscodeSettingsConfig = process . argv [ process . argv . indexOf ( '--vscode-settings' ) + 1 ] ;
517- if ( ! vscodeSettingsConfig || vscodeSettingsConfig . startsWith ( '-' ) ) {
518- clack . log . error ( lightRed ( `Missing argument for --vscode-settings.` ) ) ;
519- process . exit ( 1 ) ;
520- }
521- const vscodeSettingsFile = resolvePath ( vscodeSettingsConfig ) ;
522- const vscodeSettings = getVSCodeFormattingSettings ( vscodeSettingsFile ) ;
523- formattingSettings . typescript = {
524- ...formattingSettings . typescript ,
525- ...vscodeSettings . typescript ,
526- } ;
527- formattingSettings . javascript = {
528- ...formattingSettings . javascript ,
529- ...vscodeSettings . javascript ,
530- } ;
531- formattingSettings . vue = {
532- ...formattingSettings . vue ,
533- ...vscodeSettings . vue ,
534- } ;
535- }
536-
537- return formattingSettings ;
538- }
539-
540477 async function getBuiltConfig ( configFile : string ) {
541478 if ( ! builtConfigs . has ( configFile ) ) {
542479 builtConfigs . set ( configFile , core . buildConfig ( configFile , ts . sys . createHash , spinner , ( s , code ) => log ( darkGray ( s ) , code ) ) ) ;
0 commit comments