Skip to content

Commit

Permalink
feat: disable eslint for generated files (#165)
Browse files Browse the repository at this point in the history
Since tslint is about to be deprecated people start to migrate to
eslint. Therefore extend the convenience of adding a disable-comment to
eslint as well.

Signed-off-by: Mathis Wiehl <[email protected]>
  • Loading branch information
Mathis authored and kevin-greene-ck committed Jul 18, 2019
1 parent a60bcb1 commit 9de3b62
Show file tree
Hide file tree
Showing 112 changed files with 120 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const pkg = require('../../package.json')

const tslintDisable: string = ' tslint:disable '

const eslintDisable: string = ' eslint-disable '

const prefaceComment: string = `
* Autogenerated by @creditkarma/thrift-typescript v${pkg.version}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand All @@ -16,6 +18,13 @@ function generatePreface(req: ts.Statement): void {
true,
)

ts.addSyntheticLeadingComment(
req,
ts.SyntaxKind.MultiLineCommentTrivia,
eslintDisable,
true,
)

ts.addSyntheticLeadingComment(
req,
ts.SyntaxKind.MultiLineCommentTrivia,
Expand Down
1 change: 1 addition & 0 deletions src/tests/unit/fixtures/apache/generated/Code.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
1 change: 1 addition & 0 deletions src/tests/unit/fixtures/apache/generated/SharedEnum.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
1 change: 1 addition & 0 deletions src/tests/unit/fixtures/apache/generated/SharedService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
1 change: 1 addition & 0 deletions src/tests/unit/fixtures/apache/generated/SharedStruct.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
1 change: 1 addition & 0 deletions src/tests/unit/fixtures/apache/generated/SharedUnion.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
1 change: 1 addition & 0 deletions src/tests/unit/fixtures/apache/generated/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
1 change: 1 addition & 0 deletions src/tests/unit/fixtures/apache/generated/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* tslint:disable */
/* eslint-disable */
/*
* Autogenerated by @creditkarma/thrift-typescript v{{VERSION}}
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Expand Down
Loading

0 comments on commit 9de3b62

Please sign in to comment.