Skip to content

Commit 35ccaeb

Browse files
authored
style: πŸ’„ Update if curly brace statements (#3023)
1 parent bf13407 commit 35ccaeb

File tree

24 files changed

+51
-27
lines changed

24 files changed

+51
-27
lines changed

β€Žaddons/api/.eslintrc.jsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module.exports = {
2626
browser: true,
2727
},
2828
rules: {
29+
curly: ['error', 'multi-line', 'consistent'],
2930
'ember/no-get': 'off',
3031
'ember/no-get-with-default': 'off',
3132
'ember/no-computed-properties-in-native-classes': 'off',

β€Žaddons/api/addon/abilities/role.jsβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,11 @@ export default class RoleAbility extends ModelAbility {
5959
const type = this.model.constructor.modelName;
6060
const typeIsValid =
6161
type === 'user' || type === 'group' || type === 'managed-group';
62-
if (!typeIsValid)
62+
if (!typeIsValid) {
6363
throw new InvalidRolePrincipalTypeError(
6464
`Expected a role principal of type 'user', 'group', or 'managed-group'. Got '${type}'.`,
6565
);
66+
}
6667
return this.can.can(`read ${type}`, this.model);
6768
}
6869
}

β€Žaddons/api/addon/serializers/account.jsβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ export default class AccountSerializer extends ApplicationSerializer {
9898
serialized.attributes = {};
9999
}
100100
// New record case
101-
if (password && snapshot?.record?.isNew)
101+
if (password && snapshot?.record?.isNew) {
102102
serialized.attributes.password = password;
103+
}
103104
// Set password custom method
104105
if (snapshot?.adapterOptions?.method === 'set-password') {
105106
serialized = this.serializeForSetPassword(snapshot, password);

β€Žaddons/api/addon/serializers/credential-store.jsβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ export default class CredentialStoreSerializer extends ApplicationSerializer {
2828
if (
2929
!serialized.attributes?.client_certificate_key &&
3030
serialized.attributes?.client_certificate
31-
)
31+
) {
3232
delete serialized.attributes.client_certificate_key;
33+
}
3334
}
3435
return serialized;
3536
}

β€Žaddons/api/addon/serializers/storage-bucket.jsβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ export default class StorageBucketSerializer extends ApplicationSerializer {
7676
// This deletes any fields that don't belong to the record's credential type
7777
if (options.isNestedAttribute && json.attributes) {
7878
// The key must be included in the fieldsByType list above
79-
if (!fieldsByCredentialType[credentialType].includes(key))
79+
if (!fieldsByCredentialType[credentialType].includes(key)) {
8080
// API requires these fields to be null
8181
json.attributes[key] = null;
82+
}
8283
}
8384

8485
//json.secrets is only present, if there are any updates to the secret fields

β€Žaddons/api/addon/serializers/target.jsβ€Ž

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,18 @@ export default class TargetSerializer extends ApplicationSerializer {
3333
const injectedApplicationCredentialSourceIDs =
3434
snapshot?.adapterOptions?.injectedApplicationCredentialSourceIDs;
3535

36-
if (brokeredCredentialSourceIDs)
36+
if (brokeredCredentialSourceIDs) {
3737
serialized = this.serializeWithBrokeredCredentialSources(
3838
snapshot,
3939
brokeredCredentialSourceIDs,
4040
);
41-
if (injectedApplicationCredentialSourceIDs)
41+
}
42+
if (injectedApplicationCredentialSourceIDs) {
4243
serialized = this.serializeWithInjectedApplicationCredentialSources(
4344
snapshot,
4445
injectedApplicationCredentialSourceIDs,
4546
);
47+
}
4648

4749
if (isNew && serialized?.with_aliases) {
4850
// API expects scope id along with every alias value

β€Žaddons/api/addon/serializers/user.jsβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ export default class UserSerializer extends ApplicationSerializer {
1818
serialize(snapshot) {
1919
let serialized = super.serialize(...arguments);
2020
const accountIDs = snapshot?.adapterOptions?.accountIDs;
21-
if (accountIDs)
21+
if (accountIDs) {
2222
serialized = this.serializewithAccounts(snapshot, accountIDs);
23+
}
2324
return serialized;
2425
}
2526

β€Žaddons/api/mirage/config.jsβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,10 +542,11 @@ function routes() {
542542
session.update({
543543
status: pickRandomStatusString(),
544544
});
545-
if (session.id.split('-').pop() % 2)
545+
if (session.id.split('-').pop() % 2) {
546546
session.update({
547547
userId: 'authenticateduser',
548548
});
549+
}
549550
});
550551
}
551552
if (recursive && scope_id === 'global') {

β€Žaddons/auth/.eslintrc.jsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module.exports = {
2626
browser: true,
2727
},
2828
rules: {
29+
curly: ['error', 'multi-line', 'consistent'],
2930
'ember/no-get': 'off',
3031
'ember/no-get-with-default': 'off',
3132
'ember/no-computed-properties-in-native-classes': 'off',

β€Žaddons/core/.eslintrc.jsβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ module.exports = {
2626
browser: true,
2727
},
2828
rules: {
29+
curly: ['error', 'multi-line', 'consistent'],
2930
'ember/no-get': 'off',
3031
'ember/no-get-with-default': 'off',
3132
'ember/no-computed-properties-in-native-classes': 'off',

0 commit comments

Comments
Β (0)