caverav / auditforge

Use shorthand property syntax for object literals JS-0240
Anti-pattern
Minor
11 days ago11 days old
Expected property shorthand
1145// Update audit parent
1146AuditSchema.statics.updateParent = (isAdmin, auditId, userId, parentId) => {
1147  return new Promise(async (resolve, reject) => {
1148    var query = Audit.findByIdAndUpdate(auditId, { parentId: parentId });1149    if (!isAdmin) query.or([{ creator: userId }, { collaborators: userId }]);
1150    query
1151      .exec()
Expected property shorthand
 989                sortAuto: true,
 990              }; // set a default sort option
 991
 992            return { category: key, findings: value, sortOption: sortOption }; 993          })
 994          .value();
 995
Expected property shorthand
234
235        var auditType = {
236          name: 'Web',
237          templates: templates,238        };
239        var response = await request(app)
240          .post('/api/data/audit-types')
Expected property shorthand
214
215        var auditType = {
216          name: 'Web',
217          templates: templates,218        };
219        var response = await request(app)
220          .post('/api/data/audit-types')
Expected property shorthand
192
193        var auditType = {
194          name: 'Wifi',
195          templates: templates,196          stage: 'itdoesnotexist',
197        };
198