Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
disallowObjectKeysOnNewLine: correct error message
Browse files Browse the repository at this point in the history
Fixes #2229
  • Loading branch information
markelog committed May 13, 2016
1 parent 729db94 commit 819e75c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/disallow-object-keys-on-new-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports.prototype = {
errors.assert.sameLine({
token: propertyNode.getPreviousCodeToken(),
nextToken: propertyNode.getFirstToken(),
message: 'Object keys must go on a new line'
message: 'Object keys should be on the same line'
});
}
});
Expand Down
5 changes: 5 additions & 0 deletions test/specs/rules/disallow-object-keys-on-new-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ describe('rules/disallow-object-keys-on-new-line', function() {
it('should not report object with one key', function() {
expect(checker.checkString('var a = {a: "b"};')).to.have.no.errors();
});

it('should report correct error message', function() {
expect(checker.checkString('foo({foo: "bar",\nbar: "baz"})')).contains
.one.error('disallowObjectKeysOnNewLine: Object keys should be on the same line');
});
});

0 comments on commit 819e75c

Please sign in to comment.