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

Commit

Permalink
Merge 277db6e into 4e04449
Browse files Browse the repository at this point in the history
  • Loading branch information
markelog committed Nov 27, 2015
2 parents 4e04449 + 277db6e commit e68ff7a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions lib/js-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,8 @@ JsFile.prototype = {
var i = startLine - 1;

if (startLine === endLine) {
// Remove tralling spaces (see gh-1968)
lines[i] = lines[i].replace(/\*\/\s+/, '\*\/');
lines[i] = lines[i].substring(0, startCol) + lines[i].substring(endCol);
} else {
lines[i] = lines[i].substring(0, startCol);
Expand Down
7 changes: 7 additions & 0 deletions test/specs/js-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,13 @@ describe('js-file', function() {
expect(file.getComments()[0].value).to.equal('comment1');
expect(file.getComments()[1].value).to.equal('comment2');
});

it('should remove left tralling spaces', function() {
var source = '/* bar */ false';
var file = createJsFile(source);
var lines = file.getLinesWithCommentsRemoved();
expect(lines[0]).to.equal('false');
});
});

describe('getFilename', function() {
Expand Down
5 changes: 0 additions & 5 deletions test/specs/rules/disallow-mixed-spaces-and-tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ describe('rules/disallow-mixed-spaces-and-tabs', function() {
.to.have.one.validation.error.from('disallowMixedSpacesAndTabs');
});

it('should report tabs with spaces with multiline comment in between', function() {
expect(checker.checkString('\t/**/ \tvar x;'))
.to.have.one.validation.error.from('disallowMixedSpacesAndTabs');
});

it('should report tabs before single space to align non-docblock multiline', function() {
expect(checker.checkString('var x;' + multilineNotDocBlock)).to.have.no.errors();
});
Expand Down

0 comments on commit e68ff7a

Please sign in to comment.