Skip to content

Commit

Permalink
fix: 🐛 remove unused import declaration (#9)
Browse files Browse the repository at this point in the history
* fix: 🐛 remove unused import declaration

* chore: 🤖 change circle ci so it'll build my branch
  • Loading branch information
johngeorgewright authored and ForbesLindesay committed Mar 22, 2019
1 parent f8d0277 commit 1e29431
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ workflows:
all:
jobs:
- test:
context: common-env
filters:
branches:
ignore:
Expand All @@ -77,4 +76,4 @@ workflows:
only: master
jobs:
- test:
context: common-env
context: common-env
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ Usage: typescript-json-schema <path-to-typescript-file> <type>
Options:
--help Show help [boolean]
--version Show version number [boolean]
--collection Process the file as a collection of types, instead of
one single type. [boolean] [default: false]
--refs Create shared ref definitions. [boolean] [default: true]
--aliasRefs Create shared ref definitions for the type aliases.
[boolean] [default: false]
Expand Down Expand Up @@ -87,6 +85,24 @@ Options:
--rejectDateType Rejects Date fields in type definitions.
[boolean] [default: false]
--id ID of schema. [string] [default: ""]
--uniqueItems Validate `uniqueItems` keyword [boolean] [default: true]
--unicode calculate correct length of strings with unicode pairs
(true by default). Pass false to use .length of strings
that is faster, but gives "incorrect" lengths of strings
with unicode pairs - each unicode pair is counted as two
characters. [boolean] [default: true]
--nullable support keyword "nullable" from Open API 3
specification. [boolean] [default: true]
--format formats validation mode ('fast' by default). Pass 'full'
for more correct and slow validation or false not to
validate formats at all. E.g., 25:00:00 and 2015/14/33
will be invalid time and date in 'full' mode but it will
be valid in 'fast' mode.
[choices: "fast", "full"] [default: "fast"]
--coerceTypes Change data type of data to match type keyword. e.g.
parse numbers in strings [boolean] [default: false]
--collection Process the file as a collection of types, instead of
one single type. [boolean] [default: false]
--useNamedExport Type name is a named export, rather than the default
export of the file [boolean] [default: false]
-* [default: []]
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/output/ComplexExample.valiator.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {inspect} from 'util';
import Ajv = require('ajv');
import {Context} from 'koa';
import {inspect} from 'util';
import {MyEnum, TypeA, TypeB, RequestA, RequestB} from '../../ComplexExample';
export const ajv = new Ajv({allErrors: true, coerceTypes: false});

Expand Down
3 changes: 1 addition & 2 deletions src/printValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ export function printTypeCollectionValidator(
return isKoaType(schema.definitions && schema.definitions[typeName]);
});
return [
t.IMPORT_INSPECT,
t.IMPORT_AJV,
...(koaTypes.length ? [t.IMPORT_KOA_CONTEXT] : []),
...(koaTypes.length ? [t.IMPORT_KOA_CONTEXT, t.IMPORT_INSPECT] : []),
t.importNamedTypes(symbols, relativePath),
t.declareAJV(options),
t.exportNamed(symbols),
Expand Down

0 comments on commit 1e29431

Please sign in to comment.