Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
infomiho committed Sep 20, 2024
1 parent 3ebe67a commit 78fa569
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions waspc/src/Wasp/ExternalConfig/TsConfig.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ data CompilerOptions = CompilerOptions
instance FromJSON CompilerOptions where
parseJSON = withObject "CompilerOptions" $ \v ->
CompilerOptions
-- We couldn't use the Generic deriving for this because of the _ prefix in the field name.
-- We couldn't use the Generic deriving for this because of the _ prefix in the "module" field name.
<$> v .:? "module"
<*> v .:? "target"
<*> v .:? "moduleResolution"
Expand All @@ -62,7 +62,6 @@ analyzeTsConfigContent :: Path' Abs (Dir WaspProjectDir) -> IO (Either [CompileE
analyzeTsConfigContent waspDir = runExceptT $ do
tsConfigFile <- ExceptT findTsConfigOrError
tsConfig <- ExceptT $ readTsConfigFile tsConfigFile
lift $ print tsConfig
ExceptT $ validateTsConfig tsConfig
where
findTsConfigOrError = maybeToEither [fileNotFoundMessage] <$> findTsConfigFile waspDir
Expand Down Expand Up @@ -127,5 +126,5 @@ validateRequiredField fieldName expectedValue maybeUserProvidedValue = case mayb
then [invalidValueErrorMessage]
else []
where
invalidValueErrorMessage = unwords ["Invalid value for the", show fieldName, "field in tsconfig.json file, expected:", showJs expectedValue ++ "."]
invalidValueErrorMessage = unwords ["Invalid value for the", show fieldName, "field in tsconfig.json file, expected value:", showJs expectedValue ++ "."]
missingFieldErrorMessage = unwords ["The", show fieldName, "field is missing in tsconfig.json. Expected value:", showJs expectedValue ++ "."]

0 comments on commit 78fa569

Please sign in to comment.