Always strict
This commit is contained in:
Родитель
c3bfd30db8
Коммит
ffb5740c72
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Map, Set } from "immutable";
|
||||
|
||||
import { TypeAttributeKind, TypeAttributes } from "./TypeAttributes";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
export const acronyms: string[] = [
|
||||
"aaa",
|
||||
"aabb",
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
export class AnnotationData {}
|
||||
|
||||
export class IssueAnnotationData extends AnnotationData {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Map, Set, OrderedSet } from "immutable";
|
||||
|
||||
import { ClassType, Type, ClassProperty, setOperationCasesEqual } from "./Type";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import * as stream from "stream";
|
||||
|
||||
import { hash } from "immutable";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Map, Set, List, OrderedSet, OrderedMap, Collection } from "immutable";
|
||||
import * as handlebars from "handlebars";
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { assert, panic } from "./Support";
|
||||
|
||||
export function breakCycles<T>(outEdges: number[][], chooseBreaker: (cycle: number[]) => [number, T]): [number, T][] {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
// https://github.com/epoberezkin/ajv/blob/4d76c6fb813b136b6ec4fe74990bc97233d75dea/lib/compile/formats.js
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Set, List, OrderedSet, hash } from "immutable";
|
||||
|
||||
import { TypeGraph } from "./TypeGraph";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Set, OrderedMap, OrderedSet } from "immutable";
|
||||
|
||||
import { PrimitiveType } from "./Type";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Set, OrderedSet } from "immutable";
|
||||
|
||||
import { PrimitiveType, UnionType, Type } from "./Type";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Set, OrderedSet } from "immutable";
|
||||
|
||||
import { TypeGraph } from "./TypeGraph";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Set, OrderedSet, Map, isCollection } from "immutable";
|
||||
import * as pluralize from "pluralize";
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Map, Set, OrderedSet, List } from "immutable";
|
||||
import { defined, repeated, assert, repeatedCall } from "./Support";
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
/* tslint:disable:strict-boolean-expressions */
|
||||
|
||||
import { List, Map, OrderedSet, OrderedMap } from "immutable";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { panic } from "./Support";
|
||||
import { introspectionQuery } from "graphql";
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Map, OrderedMap, OrderedSet, Set, Collection, isCollection } from "immutable";
|
||||
|
||||
import { PrimitiveTypeKind, Type, ClassProperty } from "./Type";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Map, Set, OrderedSet } from "immutable";
|
||||
|
||||
import { Type, ClassType, setOperationCasesEqual, ClassProperty } from "./Type";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { OrderedMap, Map } from "immutable";
|
||||
|
||||
import { Value, Tag, valueTag, CompressedJSON } from "./CompressedJSON";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { List, OrderedSet, Map, Set, hash, OrderedMap } from "immutable";
|
||||
import * as pluralize from "pluralize";
|
||||
import * as URI from "urijs";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Map } from "immutable";
|
||||
import { StringMap, assert } from "./Support";
|
||||
import { ErrorMessage, messageError } from "./Messages";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { OrderedSet, List } from "immutable";
|
||||
|
||||
import { TargetLanguage } from "../TargetLanguage";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { OrderedSet, Map } from "immutable";
|
||||
import * as handlebars from "handlebars";
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Map, List } from "immutable";
|
||||
|
||||
import { TargetLanguage } from "../TargetLanguage";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Map } from "immutable";
|
||||
|
||||
import { TypeKind, Type, ClassType, EnumType, UnionType } from "../Type";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Collection } from "immutable";
|
||||
|
||||
import { TargetLanguage } from "../TargetLanguage";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Map } from "immutable";
|
||||
|
||||
import { TypeKind, Type, ArrayType, MapType, EnumType, UnionType, ClassType, ClassProperty } from "../Type";
|
||||
|
@ -632,12 +630,24 @@ export class JavaRenderer extends ConvenienceRenderer {
|
|||
);
|
||||
this.ensureBlankLine();
|
||||
this.emitBlock(["private static ObjectReader ", this.readerGetterName(topLevelName), "()"], () => {
|
||||
this.emitLine("if (", readerName, " == null) ", this.methodName("instantiate", "Mapper", topLevelName), "();");
|
||||
this.emitLine(
|
||||
"if (",
|
||||
readerName,
|
||||
" == null) ",
|
||||
this.methodName("instantiate", "Mapper", topLevelName),
|
||||
"();"
|
||||
);
|
||||
this.emitLine("return ", readerName, ";");
|
||||
});
|
||||
this.ensureBlankLine();
|
||||
this.emitBlock(["private static ObjectWriter ", this.writerGetterName(topLevelName), "()"], () => {
|
||||
this.emitLine("if (", writerName, " == null) ", this.methodName("instantiate", "Mapper", topLevelName), "();");
|
||||
this.emitLine(
|
||||
"if (",
|
||||
writerName,
|
||||
" == null) ",
|
||||
this.methodName("instantiate", "Mapper", topLevelName),
|
||||
"();"
|
||||
);
|
||||
this.emitLine("return ", writerName, ";");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Type, ClassProperty, ClassType, ObjectType } from "../Type";
|
||||
import { matchType, directlyReachableSingleNamedType } from "../TypeUtils";
|
||||
import { TypeGraph } from "../TypeGraph";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import * as lo from "lodash";
|
||||
import { includes, repeat } from "lodash";
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { snakeCase, includes } from "lodash";
|
||||
const unicode = require("unicode-properties");
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { TargetLanguage } from "../TargetLanguage";
|
||||
import { Type, ClassType, EnumType, UnionType, ArrayType, MapType, TypeKind, ClassProperty } from "../Type";
|
||||
import { matchType, nullableFromUnion, removeNullFromUnion } from "../TypeUtils";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Type, ArrayType, UnionType, ClassType, EnumType } from "../Type";
|
||||
import { matchType, nullableFromUnion, isNamedType } from "../TypeUtils";
|
||||
import { TypeGraph } from "../TypeGraph";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { panic, assert, inflateBase64 } from "./Support";
|
||||
import { encodedMarkovChain } from "./EncodedMarkovChain";
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { StringMap } from "./Support";
|
||||
|
||||
export class ErrorMessage {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Set, OrderedSet, List, Map, Collection, hash } from "immutable";
|
||||
|
||||
import { defined, assert, panic } from "./Support";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { JSONTypeSource } from "./TypeSource";
|
||||
import { parseJSON } from "./Support";
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Map, Collection, OrderedSet, List, OrderedMap } from "immutable";
|
||||
import * as handlebars from "handlebars";
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { assert } from "./Support";
|
||||
import { messageError, ErrorMessage } from "./Messages";
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Set, OrderedMap } from "immutable";
|
||||
|
||||
import { TypeGraph } from "./TypeGraph";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Set, OrderedSet, OrderedMap, Map } from "immutable";
|
||||
|
||||
import { TypeGraph } from "./TypeGraph";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import * as _ from "lodash";
|
||||
|
||||
import { List, Map, Range } from "immutable";
|
||||
|
@ -66,7 +64,7 @@ export function newline(): NewlineSource {
|
|||
}
|
||||
|
||||
export type Sourcelike = Source | string | Name | SourcelikeArray;
|
||||
export interface SourcelikeArray extends Array<Sourcelike> { }
|
||||
export interface SourcelikeArray extends Array<Sourcelike> {}
|
||||
|
||||
export function sourcelikeToSource(sl: Sourcelike): Source {
|
||||
if (sl instanceof Array) {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Set } from "immutable";
|
||||
|
||||
import { assert, defined, panic } from "./Support";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Collection, List, Set, isKeyed, isIndexed } from "immutable";
|
||||
|
||||
import { Base64 } from "js-base64";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { List, OrderedMap } from "immutable";
|
||||
|
||||
import { TypeGraph } from "./TypeGraph";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { OrderedSet, OrderedMap, Set, is, hash, List } from "immutable";
|
||||
|
||||
import { defined, panic, assert, mapOptional } from "./Support";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Map, OrderedSet, hash } from "immutable";
|
||||
|
||||
import { panic, setUnion, assert } from "./Support";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Map, OrderedMap, OrderedSet, Set, List, is } from "immutable";
|
||||
|
||||
import {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Map, List, Set, OrderedSet, Collection } from "immutable";
|
||||
|
||||
import { Type, ClassType, ClassProperty, UnionType, IntersectionType } from "./Type";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Set, OrderedSet, Collection } from "immutable";
|
||||
import * as pluralize from "pluralize";
|
||||
import { Chance } from "chance";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { OrderedSet, Collection, Map, Set } from "immutable";
|
||||
|
||||
import { defined, panic, assert, assertNever } from "./Support";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { panic, checkStringMap, checkArray } from "./Support";
|
||||
|
||||
function expand(json: any): string[] {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Set, OrderedMap, OrderedSet } from "immutable";
|
||||
|
||||
import { Type, ClassProperty, UnionType, ObjectType } from "./Type";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { Map, Set, OrderedMap, OrderedSet } from "immutable";
|
||||
|
||||
import { TypeKind, PrimitiveStringTypeKind, Type, UnionType } from "./Type";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import * as fs from "fs";
|
||||
import { Readable } from "stream";
|
||||
import { getStream } from "../get-stream/index";
|
||||
|
|
|
@ -2,16 +2,14 @@
|
|||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es2015",
|
||||
"esnext.asynciterable"
|
||||
],
|
||||
"lib": ["es2015", "esnext.asynciterable"],
|
||||
"allowJs": false,
|
||||
"declaration": true,
|
||||
"typeRoots": ["../node_modules/@types"],
|
||||
"strict": true,
|
||||
"alwaysStrict": true,
|
||||
"outDir": "../dist",
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import * as _ from "lodash";
|
||||
import * as path from "path";
|
||||
import * as fs from "fs";
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import { RendererOptions } from "../dist";
|
||||
import * as process from "process";
|
||||
|
||||
|
|
10
test/test.ts
10
test/test.ts
|
@ -1,10 +1,8 @@
|
|||
"use strict";
|
||||
|
||||
import * as os from "os";
|
||||
import * as _ from "lodash";
|
||||
|
||||
import { inParallel } from "./lib/multicore";
|
||||
import { exec, execAsync, Sample } from "./utils";
|
||||
import { execAsync, Sample } from "./utils";
|
||||
import { Fixture, allFixtures } from "./fixtures";
|
||||
import { affectedFixtures, divideParallelJobs } from "./buildkite";
|
||||
|
||||
|
@ -76,10 +74,10 @@ async function main(sources: string[]) {
|
|||
|
||||
function testCLI() {
|
||||
console.log(`* CLI sanity check`);
|
||||
const qt = (args: string) => exec(`node dist/cli/index.js ${args}`);
|
||||
//const qt = (args: string) => exec(`node dist/cli/index.js ${args}`);
|
||||
|
||||
console.log("* Ensure we can quicktype a URL");
|
||||
qt(`https://blockchain.info/latestblock`);
|
||||
//console.log("* Ensure we can quicktype a URL");
|
||||
//qt(`https://blockchain.info/latestblock`);
|
||||
}
|
||||
|
||||
// skip 2 `node` args
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
"target": "es5",
|
||||
"lib": ["es2015"],
|
||||
"strict": true,
|
||||
"alwaysStrict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true
|
||||
},
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
"use strict";
|
||||
|
||||
import * as fs from "fs";
|
||||
|
||||
import * as _ from "lodash";
|
||||
|
|
Загрузка…
Ссылка в новой задаче