Skip to content

Commit

Permalink
Merge pull request #267 from ikatyang/feat/tslint/type-literal-delimiter
Browse files Browse the repository at this point in the history
feat(rules): add tslint/type-literal-delimiter
  • Loading branch information
alexjoverm committed Feb 4, 2019
2 parents a9d99cf + c632154 commit 4898124
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/tslint/type-literal-delimiter/__snapshots__/test.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`should affect error message after formatting 1`] = `
"
<<<<<< before
ERROR: (type-literal-delimiter) /src/tslint/type-literal-delimiter/test.ts[2, 12]: Expected type literal to use ';' instead of ','.
ERROR: (type-literal-delimiter) /src/tslint/type-literal-delimiter/test.ts[3, 11]: Expected type literal to use ';' to separate members.
======
no error
>>>>>> after
"
`;
exports[`should be pretty after formatting 1`] = `
"
<<<<<< before
type T = {
x: number,
y: string
};
======
type T = {
x: number;
y: string;
};
>>>>>> after
"
`;
4 changes: 4 additions & 0 deletions src/tslint/type-literal-delimiter/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type T = {
x: number,
y: string
};
5 changes: 5 additions & 0 deletions src/tslint/type-literal-delimiter/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"rules": {
"type-literal-delimiter": true
}
}
2 changes: 2 additions & 0 deletions tools/__snapshots__/checker.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ exports[`should be able to check multiple config files 1`] = `
[error] space-before-function-paren
[error] space-within-parens
[error] trailing-comma
[error] type-literal-delimiter
[error] typedef-whitespace
[error] whitespace
[error] Unexpected number in JSON at position 1 in <cwd>/fixtures/tslint.error.json"
Expand Down Expand Up @@ -55,6 +56,7 @@ exports[`should throw conflict rules 1`] = `
[error] space-before-function-paren
[error] space-within-parens
[error] trailing-comma
[error] type-literal-delimiter
[error] typedef-whitespace
[error] whitespace"
`;
Expand Down

0 comments on commit 4898124

Please sign in to comment.