Skip to content

Commit 68b033b

Browse files
committed
fix eslint rule for single property object
1 parent 843c110 commit 68b033b

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

tools/eslint-rules/set-proto-to-null-in-object.js

+5-9
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,12 @@ module.exports = {
5050
const firstProperty = properties[0];
5151
const firstPropertyToken = sourceCode.getFirstToken(firstProperty);
5252

53-
let fixText = `__proto__: null`;
53+
let fixText = `__proto__: null, `;
5454

55-
if (properties.length > 1) {
56-
fixText += ',';
57-
58-
if (properties[0].loc.start.line !== properties[1].loc.start.line) {
59-
fixText += '\n';
60-
} else {
61-
fixText += ' ';
62-
}
55+
if (properties.length > 1 && properties[0].loc.start.line !== properties[1].loc.start.line) {
56+
fixText += '\n';
57+
} else {
58+
fixText += ' ';
6359
}
6460

6561
// Insert the fix suggestion before the first property

0 commit comments

Comments
 (0)