Skip to content

Commit

Permalink
feat(rules): add tslint/newline-per-chained-call
Browse files Browse the repository at this point in the history
  • Loading branch information
ikatyang committed Jan 11, 2018
1 parent ecb4112 commit 15612b0
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/tslint/newline-per-chained-call/__snapshots__/test.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`should affect error message after formatting 1`] = `
"
<<<<<< before
ERROR: (newline-per-chained-call) /src/tslint/newline-per-chained-call/test.ts[4, 6]: When chaining calls, put method calls on new lines.
ERROR: (newline-per-chained-call) /src/tslint/newline-per-chained-call/test.ts[4, 12]: When chaining calls, put method calls on new lines.
======
ERROR: (newline-per-chained-call) /src/tslint/newline-per-chained-call/test.ts[1, 6]: When chaining calls, put method calls on new lines.
>>>>>> after
"
`;
exports[`should be pretty after formatting 1`] = `
"
<<<<<< before
foo()
.bar()
foo().bar().baz()
======
foo().bar();
foo()
.bar()
.baz();
>>>>>> after
"
`;
4 changes: 4 additions & 0 deletions src/tslint/newline-per-chained-call/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
foo()
.bar()

foo().bar().baz()
5 changes: 5 additions & 0 deletions src/tslint/newline-per-chained-call/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"newline-per-chained-call": true
}
}

0 comments on commit 15612b0

Please sign in to comment.