Skip to content

Commit

Permalink
feat: disable tslint (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
Forbes Lindesay authored Jun 11, 2019
1 parent 8ee2a2f commit a5f3a5d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Example.validator.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* tslint:disable */
// generated by typescript-json-validator
import {inspect} from 'util';
import Ajv = require('ajv');
import ExampleType from './Example';
Expand Down
2 changes: 2 additions & 0 deletions src/__tests__/output/ComplexExample.validator.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* tslint:disable */
// generated by typescript-json-validator
import Ajv = require('ajv');
import {MyEnum, TypeA, TypeB, RequestA, RequestB} from '../../ComplexExample';
import {inspect} from 'util';
Expand Down
4 changes: 4 additions & 0 deletions src/printValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export function printTypeCollectionValidator(
return isKoaType(schema.definitions && schema.definitions[typeName]);
});
return [
t.TSLINT_DISABLE,
t.GENERATED_COMMENT,
t.IMPORT_AJV,
t.importNamedTypes(symbols, relativePath),
...(koaTypes.length ? [t.IMPORT_INSPECT, t.DECLARE_KOA_CONTEXT] : []),
Expand Down Expand Up @@ -50,6 +52,8 @@ export function printSingleTypeValidator(
throw new Error('temp');
}
return [
t.TSLINT_DISABLE,
t.GENERATED_COMMENT,
t.IMPORT_INSPECT,
t.IMPORT_AJV,
t.importType(typeName, relativePath, {isNamedExport}),
Expand Down
3 changes: 2 additions & 1 deletion src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import Ajv = require('ajv');
import stringify = require('json-stable-stringify');
import * as TJS from 'typescript-json-schema';

export type GENERATED_COMMENT = `// generated by typescript-json-validator`;
export const TSLINT_DISABLE = `/* tslint:disable */`;
export const GENERATED_COMMENT = `// generated by typescript-json-validator`;

export const IMPORT_INSPECT = `import {inspect} from 'util';`;
export const IMPORT_AJV = `import Ajv = require('ajv');`;
Expand Down

0 comments on commit a5f3a5d

Please sign in to comment.