Move let declaration closer to where it's used

This commit is contained in:
Jeroen Engels 2023-04-01 09:59:25 +02:00
parent d3275d6fb1
commit aab719af66

View File

@ -4657,15 +4657,6 @@ computeModule ({ ruleProjectVisitors, module_, project, incoming } as params) =
moduleName =
Node.value (moduleNameNode (ProjectModule.ast module_).moduleDefinition)
( moduleNameLookupTable, newProject ) =
-- TODO Try to compute this later, once we know for sure that the rules we will run want the lookup table
-- TODO If the file has changed, then compute the module docs anyway.
if requestedData.moduleNameLookupTable then
Review.ModuleNameLookupTable.Compute.compute moduleName module_ project
else
( ModuleNameLookupTableInternal.empty moduleName, project )
filePath : String
filePath =
ProjectModule.path module_
@ -4698,6 +4689,15 @@ computeModule ({ ruleProjectVisitors, module_, project, incoming } as params) =
else
let
( moduleNameLookupTable, newProject ) =
-- TODO Try to compute this later, once we know for sure that the rules we will run want the lookup table
-- TODO If the file has changed, then compute the module docs anyway.
if requestedData.moduleNameLookupTable then
Review.ModuleNameLookupTable.Compute.compute moduleName module_ project
else
( ModuleNameLookupTableInternal.empty moduleName, project )
availableData : AvailableData
availableData =
{ ast = ProjectModule.ast module_