Skip to content

Commit 0e42d88

Browse files
authored
enable Biome useBlockStatements rule (#1508)
1 parent b077452 commit 0e42d88

File tree

93 files changed

+1350
-474
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+1350
-474
lines changed

app.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ function createApp(config) {
243243
} else {
244244
// Don't log Azure robot liveness checks
245245
// https://feedback.azure.com/forums/169385-web-apps/suggestions/32120617-document-healthcheck-url-requirement-for-custom-co
246-
if (!request?.url?.includes('robots933456.txt')) logger.error(`SvcRequestFailure: ${request.url}`, error)
246+
if (!request?.url?.includes('robots933456.txt')) {
247+
logger.error(`SvcRequestFailure: ${request.url}`, error)
248+
}
247249

248250
// set locals, only providing error in development
249251
response.locals.message = error.message

bin/config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ function loadOne(spec, namespace) {
3737
const getPath = (namespace ? `${namespace}.` : '') + requirePath
3838
let target = get(providers, getPath)
3939
try {
40-
if (!target) target = require(requirePath)
40+
if (!target) {
41+
target = require(requirePath)
42+
}
4143
return objectPath ? get(target, objectPath) : target
4244
} catch (e) {
4345
const message = e instanceof Error ? e.message : String(e)

biome.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
},
4444
"style": {
4545
"noParameterAssign": "off",
46+
"useBlockStatements": "error",
4647
"useDefaultParameterLast": "off"
4748
},
4849
"complexity": {

business/aggregator.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ class AggregationService {
8080
mergeDefinitions(result, data.summary)
8181
}
8282
}
83-
if (!tools.length) return null
83+
if (!tools.length) {
84+
return null
85+
}
8486
set(result, 'described.tools', tools.reverse())
8587
const cdSummarized = this._findData('clearlydefined', summarized)
8688
this._overrideDeclaredLicense(result, cdSummarized, coordinates)
@@ -113,8 +115,12 @@ class AggregationService {
113115
*/
114116
_findData(toolSpec, summarized) {
115117
const [tool, toolVersion] = toolSpec.split('/')
116-
if (!summarized[tool]) return null
117-
if (toolVersion) return { toolSpec, summary: summarized[tool][toolVersion] }
118+
if (!summarized[tool]) {
119+
return null
120+
}
121+
if (toolVersion) {
122+
return { toolSpec, summary: summarized[tool][toolVersion] }
123+
}
118124

119125
const versions = Object.getOwnPropertyNames(summarized[tool])
120126
const latest = getLatestVersion(versions)
@@ -131,9 +137,13 @@ class AggregationService {
131137
*/
132138
_normalizeFiles(result, cdSummarized, coordinates) {
133139
const cdFiles = get(cdSummarized, 'summary.files')
134-
if (!cdFiles || !cdFiles.length) return
140+
if (!cdFiles || !cdFiles.length) {
141+
return
142+
}
135143
const difference = (result.files?.length || 0) - cdFiles.length
136-
if (!difference) return
144+
if (!difference) {
145+
return
146+
}
137147
this.logger.info('difference between summary file count and cd file count', {
138148
count: difference,
139149
coordinates: coordinates.toString()

0 commit comments

Comments
 (0)