Skip to content

Commit 810ea8e

Browse files
committed
remove require from import
1 parent 0820f42 commit 810ea8e

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@ajv-validator/config": "^0.3.0",
4747
"@types/glob": "^7.1.3",
4848
"@types/js-yaml": "^3.12.5",
49-
"@types/json5": "2.2.0",
49+
"@types/json5": "^2.2.0",
5050
"@types/minimist": "^1.2.1",
5151
"@types/mocha": "^8.0.4",
5252
"@types/node": "^14.14.10",

src/commands/ajv.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import Ajv7, {Plugin} from "ajv"
44
import Ajv2019 from "ajv/dist/2019"
55
import {Service} from "ts-node"
66
import {getOptions} from "./options"
7-
import util = require("./util")
8-
import path = require("path")
9-
import draft6metaSchema = require("ajv/lib/refs/json-schema-draft-06.json")
7+
import * as util from "./util"
8+
import * as path from "path"
9+
import * as draft6metaSchema from "ajv/lib/refs/json-schema-draft-06.json"
1010

1111
type AjvMethod = "addSchema" | "addMetaSchema"
1212

src/commands/compile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type {ParsedArgs} from "minimist"
44
import {getFiles, openFile} from "./util"
55
import getAjv from "./ajv"
66
import standaloneCode from "ajv/dist/standalone"
7-
import fs = require("fs")
7+
import * as fs from "fs"
88

99
const cmd: Command = {
1010
execute,

src/commands/migrate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import type {AnySchemaObject} from "ajv"
33
import type {ParsedArgs} from "minimist"
44
import {getFiles, openFile} from "./util"
55
import getAjv from "./ajv"
6-
import fs = require("fs")
6+
import * as fs from "fs"
77
import * as migrate from "json-schema-migrate"
8-
import jsonPatch = require("fast-json-patch")
8+
import * as jsonPatch from "fast-json-patch"
99

1010
const cmd: Command = {
1111
execute,

src/commands/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Ajv, {CodeOptions, Options} from "ajv/dist/2019"
22
import type {SchemaObject, SchemaMap, ErrorObject} from "ajv/dist/types"
33
import type {ParsedArgs} from "minimist"
4-
import glob = require("glob")
4+
import * as glob from "glob"
55

66
const boolOrNat = {type: ["boolean", "integer"], minimum: 0}
77
const CODE = "code-"

src/commands/util.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type Ajv from "ajv"
2-
import glob = require("glob")
3-
import path = require("path")
4-
import fs = require("fs")
5-
import yaml = require("js-yaml")
6-
import JSON5 = require("json5")
2+
import * as glob from "glob"
3+
import * as path from "path"
4+
import * as fs from "fs"
5+
import * as yaml from "js-yaml"
6+
import * as JSON5 from "json5"
77
import {AnyValidateFunction} from "ajv/dist/core"
88

99
export function getFiles(args: string | string[]): string[] {

src/commands/validate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type {Command} from "./types"
22
import type {ParsedArgs} from "minimist"
33
import {compile, getFiles, openFile, logJSON} from "./util"
44
import getAjv from "./ajv"
5-
import jsonPatch = require("fast-json-patch")
5+
import * as jsonPatch from "fast-json-patch"
66

77
const cmd: Command = {
88
execute,

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /usr/bin/env node
22

3-
import minimist = require("minimist")
3+
import * as minimist from "minimist"
44
import commands from "./commands"
55
import {checkOptions} from "./commands/options"
66
import usage from "./commands/usage"

test/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {exec, ExecException} from "child_process"
2-
import path = require("path")
2+
import * as path from "path"
33
const cwd = path.join(__dirname, "..")
44

55
export default function cli(

0 commit comments

Comments
 (0)