Skip to content

Commit 5f32f21

Browse files
committed
chore: consistency for curly braces
1 parent 9118b09 commit 5f32f21

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"rules": {
1313
"jest/no-focused-tests": "error",
14+
"curly": ["error", "multi-line"],
1415
"arrow-body-style": 0,
1516
"default-case": 0,
1617
"import/order": [

src/jsonLogic.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ function replaceHandlebarsTemplates({
150150
return logic.getScope(parentID).applyComputedValueInField(key.trim(), formValues, fieldName);
151151
});
152152
}
153+
return toReplace;
153154
}
154155

155156
export function calculateComputedAttributes(fieldParams, { parentID = 'root' } = {}) {
@@ -174,15 +175,17 @@ export function calculateComputedAttributes(fieldParams, { parentID = 'root' } =
174175

175176
function handleComputedAttribute(logic, formValues, parentID) {
176177
return ([key, value]) => {
177-
if (key === 'description')
178+
if (key === 'description') {
178179
return [key, replaceHandlebarsTemplates({ value, logic, formValues, parentID, name })];
180+
}
179181

180182
if (key === 'title') {
181183
return ['label', replaceHandlebarsTemplates({ value, logic, formValues, parentID, name })];
182184
}
183185

184-
if (key === 'const')
186+
if (key === 'const') {
185187
return [key, logic.getScope(parentID).applyComputedValueInField(value, formValues)];
188+
}
186189

187190
if (key === 'x-jsf-errorMessage') {
188191
return [

0 commit comments

Comments
 (0)