11import * as path from "path" ;
22import * as ts from "typescript" ;
33import { CompilerOptions , LuaLibImportKind , LuaTarget } from "./CompilerOptions" ;
4- import * as diagnostics from "./diagnostics" ;
4+ import * as diagnosticFactories from "./diagnostics" ;
55
66export interface ParsedCommandLine extends ts . ParsedCommandLine {
77 options : CompilerOptions ;
@@ -117,14 +117,14 @@ export function updateParsedConfigFile(parsedConfigFile: ts.ParsedCommandLine):
117117 if ( parsedConfigFile . raw . tstl ) {
118118 if ( hasRootLevelOptions ) {
119119 parsedConfigFile . errors . push (
120- diagnostics . tstlOptionsAreMovingToTheTstlObject ( parsedConfigFile . raw . tstl )
120+ diagnosticFactories . tstlOptionsAreMovingToTheTstlObject ( parsedConfigFile . raw . tstl )
121121 ) ;
122122 }
123123
124124 for ( const key in parsedConfigFile . raw . tstl ) {
125125 const option = optionDeclarations . find ( option => option . name === key ) ;
126126 if ( ! option ) {
127- parsedConfigFile . errors . push ( diagnostics . unknownCompilerOption ( key ) ) ;
127+ parsedConfigFile . errors . push ( diagnosticFactories . unknownCompilerOption ( key ) ) ;
128128 continue ;
129129 }
130130
@@ -187,7 +187,7 @@ function readCommandLineArgument(option: CommandLineOption, value: any): Command
187187 if ( option . isTSConfigOnly ) {
188188 return {
189189 value : undefined ,
190- error : diagnostics . optionCanOnlyBeSpecifiedInTsconfigJsonFile ( option . name ) ,
190+ error : diagnosticFactories . optionCanOnlyBeSpecifiedInTsconfigJsonFile ( option . name ) ,
191191 increment : 0 ,
192192 } ;
193193 }
@@ -203,7 +203,7 @@ function readCommandLineArgument(option: CommandLineOption, value: any): Command
203203
204204 if ( value === undefined ) {
205205 return {
206- error : diagnostics . compilerOptionExpectsAnArgument ( option . name ) ,
206+ error : diagnosticFactories . compilerOptionExpectsAnArgument ( option . name ) ,
207207 value : undefined ,
208208 increment : 0 ,
209209 } ;
@@ -225,7 +225,10 @@ function readValue(option: CommandLineOption, value: unknown): ReadValueResult {
225225 if ( typeof value !== "boolean" ) {
226226 return {
227227 value : undefined ,
228- error : diagnostics . compilerOptionRequiresAValueOfType ( option . name , "boolean" ) ,
228+ error : diagnosticFactories . compilerOptionRequiresAValueOfType (
229+ option . name ,
230+ "boolean"
231+ ) ,
229232 } ;
230233 }
231234
@@ -236,7 +239,10 @@ function readValue(option: CommandLineOption, value: unknown): ReadValueResult {
236239 if ( typeof value !== "string" ) {
237240 return {
238241 value : undefined ,
239- error : diagnostics . compilerOptionRequiresAValueOfType ( option . name , "string" ) ,
242+ error : diagnosticFactories . compilerOptionRequiresAValueOfType (
243+ option . name ,
244+ "string"
245+ ) ,
240246 } ;
241247 }
242248
@@ -245,7 +251,10 @@ function readValue(option: CommandLineOption, value: unknown): ReadValueResult {
245251 const optionChoices = option . choices . join ( ", " ) ;
246252 return {
247253 value : undefined ,
248- error : diagnostics . argumentForOptionMustBe ( `--${ option . name } ` , optionChoices ) ,
254+ error : diagnosticFactories . argumentForOptionMustBe (
255+ `--${ option . name } ` ,
256+ optionChoices
257+ ) ,
249258 } ;
250259 }
251260
@@ -256,7 +265,10 @@ function readValue(option: CommandLineOption, value: unknown): ReadValueResult {
256265 if ( ! Array . isArray ( value ) ) {
257266 return {
258267 value : undefined ,
259- error : diagnostics . compilerOptionRequiresAValueOfType ( option . name , "Array" ) ,
268+ error : diagnosticFactories . compilerOptionRequiresAValueOfType (
269+ option . name ,
270+ "Array"
271+ ) ,
260272 } ;
261273 }
262274
0 commit comments