From 6578be9008d10a7bc1a3f4c8abcee7af02f6a011 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Wed, 8 Jul 2020 19:26:39 +1000 Subject: [PATCH] feat: add --no-check option (denoland/deno#6456) This commit adds a "--no-check" option to following subcommands: - "deno cache" - "deno info" - "deno run" - "deno test" The "--no-check" options allows to skip type checking step and instead directly transpiles TS sources to JS sources. This solution uses `ts.transpileModule()` API and is just an interim solution before implementing it fully in Rust. --- encoding/_yaml/dumper/dumper.ts | 2 +- encoding/_yaml/dumper/dumper_state.ts | 6 +++--- encoding/_yaml/error.ts | 2 +- encoding/_yaml/loader/loader.ts | 2 +- encoding/_yaml/loader/loader_state.ts | 8 ++++---- encoding/_yaml/parse.ts | 2 +- encoding/_yaml/schema.ts | 4 ++-- encoding/_yaml/state.ts | 2 +- encoding/_yaml/stringify.ts | 2 +- encoding/_yaml/type.ts | 2 +- encoding/_yaml/type/binary.ts | 2 +- encoding/_yaml/type/map.ts | 2 +- encoding/_yaml/type/omap.ts | 2 +- encoding/_yaml/type/pairs.ts | 2 +- encoding/_yaml/type/seq.ts | 2 +- encoding/_yaml/type/set.ts | 2 +- encoding/yaml.ts | 13 ++++++------- hash/_wasm/hash.ts | 2 +- hash/mod.ts | 4 ++-- io/ioutil.ts | 2 +- log/handlers.ts | 2 +- log/logger.ts | 2 +- log/mod.ts | 2 +- node/_fs/_fs_access.ts | 2 +- node/_fs/_fs_chmod.ts | 2 +- node/_fs/_fs_chown.ts | 2 +- node/_fs/_fs_close.ts | 2 +- node/_fs/_fs_copy.ts | 2 +- node/_fs/_fs_dir_test.ts | 2 +- node/_fs/_fs_link.ts | 2 +- node/_fs/_fs_mkdir.ts | 8 +++++--- node/_fs/_fs_writeFile_test.ts | 2 +- node/_fs/promises/_fs_readFile.ts | 5 +++-- node/_fs/promises/_fs_writeFile.ts | 2 +- node/_fs/promises/_fs_writeFile_test.ts | 2 +- path/_util.ts | 2 +- path/posix.ts | 2 +- path/win32.ts | 2 +- textproto/mod.ts | 2 +- tsconfig_test.json | 5 +++++ 40 files changed, 62 insertions(+), 55 deletions(-) create mode 100644 tsconfig_test.json diff --git a/encoding/_yaml/dumper/dumper.ts b/encoding/_yaml/dumper/dumper.ts index 1280ee757293..2b23d475813d 100644 --- a/encoding/_yaml/dumper/dumper.ts +++ b/encoding/_yaml/dumper/dumper.ts @@ -6,7 +6,7 @@ /* eslint-disable max-len */ import { YAMLError } from "../error.ts"; -import { RepresentFn, StyleVariant, Type } from "../type.ts"; +import type { RepresentFn, StyleVariant, Type } from "../type.ts"; import * as common from "../utils.ts"; import { DumperState, DumperStateOptions } from "./dumper_state.ts"; diff --git a/encoding/_yaml/dumper/dumper_state.ts b/encoding/_yaml/dumper/dumper_state.ts index 3c1de0e0e86e..2124ecb9857f 100644 --- a/encoding/_yaml/dumper/dumper_state.ts +++ b/encoding/_yaml/dumper/dumper_state.ts @@ -3,10 +3,10 @@ // Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license. // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { Schema, SchemaDefinition } from "../schema.ts"; +import type { Schema, SchemaDefinition } from "../schema.ts"; import { State } from "../state.ts"; -import { StyleVariant, Type } from "../type.ts"; -import { ArrayObject, Any } from "../utils.ts"; +import type { StyleVariant, Type } from "../type.ts"; +import type { ArrayObject, Any } from "../utils.ts"; const _hasOwnProperty = Object.prototype.hasOwnProperty; diff --git a/encoding/_yaml/error.ts b/encoding/_yaml/error.ts index 7f305ccf2c5d..a96ab11d6cc7 100644 --- a/encoding/_yaml/error.ts +++ b/encoding/_yaml/error.ts @@ -3,7 +3,7 @@ // Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license. // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { Mark } from "./mark.ts"; +import type { Mark } from "./mark.ts"; export class YAMLError extends Error { constructor( diff --git a/encoding/_yaml/loader/loader.ts b/encoding/_yaml/loader/loader.ts index 39954c280342..4ab3e9adc78d 100644 --- a/encoding/_yaml/loader/loader.ts +++ b/encoding/_yaml/loader/loader.ts @@ -7,7 +7,7 @@ import { YAMLError } from "../error.ts"; import { Mark } from "../mark.ts"; -import { Type } from "../type.ts"; +import type { Type } from "../type.ts"; import * as common from "../utils.ts"; import { LoaderState, LoaderStateOptions, ResultType } from "./loader_state.ts"; diff --git a/encoding/_yaml/loader/loader_state.ts b/encoding/_yaml/loader/loader_state.ts index ca50fcaf1dbd..781a4a08633b 100644 --- a/encoding/_yaml/loader/loader_state.ts +++ b/encoding/_yaml/loader/loader_state.ts @@ -3,11 +3,11 @@ // Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license. // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { YAMLError } from "../error.ts"; -import { Schema, SchemaDefinition, TypeMap } from "../schema.ts"; +import type { YAMLError } from "../error.ts"; +import type { Schema, SchemaDefinition, TypeMap } from "../schema.ts"; import { State } from "../state.ts"; -import { Type } from "../type.ts"; -import { Any, ArrayObject } from "../utils.ts"; +import type { Type } from "../type.ts"; +import type { Any, ArrayObject } from "../utils.ts"; export interface LoaderStateOptions { legacy?: boolean; diff --git a/encoding/_yaml/parse.ts b/encoding/_yaml/parse.ts index 2aa0042bdd5f..9a6f325f2419 100644 --- a/encoding/_yaml/parse.ts +++ b/encoding/_yaml/parse.ts @@ -4,7 +4,7 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { CbFunction, load, loadAll } from "./loader/loader.ts"; -import { LoaderStateOptions } from "./loader/loader_state.ts"; +import type { LoaderStateOptions } from "./loader/loader_state.ts"; export type ParseOptions = LoaderStateOptions; diff --git a/encoding/_yaml/schema.ts b/encoding/_yaml/schema.ts index 579644dbb7c7..98b49203cc34 100644 --- a/encoding/_yaml/schema.ts +++ b/encoding/_yaml/schema.ts @@ -4,8 +4,8 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { YAMLError } from "./error.ts"; -import { KindType, Type } from "./type.ts"; -import { ArrayObject, Any } from "./utils.ts"; +import type { KindType, Type } from "./type.ts"; +import type { ArrayObject, Any } from "./utils.ts"; function compileList( schema: Schema, diff --git a/encoding/_yaml/state.ts b/encoding/_yaml/state.ts index 6df6dc04766e..67a105d39ef0 100644 --- a/encoding/_yaml/state.ts +++ b/encoding/_yaml/state.ts @@ -3,7 +3,7 @@ // Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license. // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { SchemaDefinition } from "./schema.ts"; +import type { SchemaDefinition } from "./schema.ts"; import { DEFAULT_SCHEMA } from "./schema/mod.ts"; export abstract class State { diff --git a/encoding/_yaml/stringify.ts b/encoding/_yaml/stringify.ts index f037631d9c85..9b3b5a80ec0c 100644 --- a/encoding/_yaml/stringify.ts +++ b/encoding/_yaml/stringify.ts @@ -4,7 +4,7 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { dump } from "./dumper/dumper.ts"; -import { DumperStateOptions } from "./dumper/dumper_state.ts"; +import type { DumperStateOptions } from "./dumper/dumper_state.ts"; export type DumpOptions = DumperStateOptions; diff --git a/encoding/_yaml/type.ts b/encoding/_yaml/type.ts index 4a2c6bbacf28..18dee338c3d8 100644 --- a/encoding/_yaml/type.ts +++ b/encoding/_yaml/type.ts @@ -3,7 +3,7 @@ // Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license. // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { ArrayObject, Any } from "./utils.ts"; +import type { ArrayObject, Any } from "./utils.ts"; export type KindType = "sequence" | "scalar" | "mapping"; export type StyleVariant = "lowercase" | "uppercase" | "camelcase" | "decimal"; diff --git a/encoding/_yaml/type/binary.ts b/encoding/_yaml/type/binary.ts index 1a321afe83b1..2433960dcc98 100644 --- a/encoding/_yaml/type/binary.ts +++ b/encoding/_yaml/type/binary.ts @@ -3,7 +3,7 @@ // https://github.com/nodeca/js-yaml/commit/665aadda42349dcae869f12040d9b10ef18d12da // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { Type } from "../type.ts"; -import { Any } from "../utils.ts"; +import type { Any } from "../utils.ts"; // [ 64, 65, 66 ] -> [ padding, CR, LF ] const BASE64_MAP = diff --git a/encoding/_yaml/type/map.ts b/encoding/_yaml/type/map.ts index dcd99abcac97..c0c8b04b722b 100644 --- a/encoding/_yaml/type/map.ts +++ b/encoding/_yaml/type/map.ts @@ -4,7 +4,7 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { Type } from "../type.ts"; -import { Any } from "../utils.ts"; +import type { Any } from "../utils.ts"; export const map = new Type("tag:yaml.org,2002:map", { construct(data): Any { diff --git a/encoding/_yaml/type/omap.ts b/encoding/_yaml/type/omap.ts index d6d751505819..785846dea900 100644 --- a/encoding/_yaml/type/omap.ts +++ b/encoding/_yaml/type/omap.ts @@ -4,7 +4,7 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { Type } from "../type.ts"; -import { Any } from "../utils.ts"; +import type { Any } from "../utils.ts"; const _hasOwnProperty = Object.prototype.hasOwnProperty; const _toString = Object.prototype.toString; diff --git a/encoding/_yaml/type/pairs.ts b/encoding/_yaml/type/pairs.ts index e999748ae735..5e3eac5ced86 100644 --- a/encoding/_yaml/type/pairs.ts +++ b/encoding/_yaml/type/pairs.ts @@ -4,7 +4,7 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { Type } from "../type.ts"; -import { Any } from "../utils.ts"; +import type { Any } from "../utils.ts"; const _toString = Object.prototype.toString; diff --git a/encoding/_yaml/type/seq.ts b/encoding/_yaml/type/seq.ts index b19565dbca8d..df2caaece6e7 100644 --- a/encoding/_yaml/type/seq.ts +++ b/encoding/_yaml/type/seq.ts @@ -4,7 +4,7 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { Type } from "../type.ts"; -import { Any } from "../utils.ts"; +import type { Any } from "../utils.ts"; export const seq = new Type("tag:yaml.org,2002:seq", { construct(data): Any { diff --git a/encoding/_yaml/type/set.ts b/encoding/_yaml/type/set.ts index 0bfe1c8db4e4..8fe04e6f0c69 100644 --- a/encoding/_yaml/type/set.ts +++ b/encoding/_yaml/type/set.ts @@ -4,7 +4,7 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { Type } from "../type.ts"; -import { Any } from "../utils.ts"; +import type { Any } from "../utils.ts"; const _hasOwnProperty = Object.prototype.hasOwnProperty; diff --git a/encoding/yaml.ts b/encoding/yaml.ts index 78866ed2a6f9..19245b2fccf4 100644 --- a/encoding/yaml.ts +++ b/encoding/yaml.ts @@ -3,13 +3,12 @@ // Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license. // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -export { ParseOptions, parse, parseAll } from "./_yaml/parse.ts"; -export { - DumpOptions as StringifyOptions, - stringify, -} from "./_yaml/stringify.ts"; -export { SchemaDefinition } from "./_yaml/schema.ts"; -export { StyleVariant } from "./_yaml/type.ts"; +export type { ParseOptions } from "./_yaml/parse.ts"; +export { parse, parseAll } from "./_yaml/parse.ts"; +export type { DumpOptions as StringifyOptions } from "./_yaml/stringify.ts"; +export { stringify } from "./_yaml/stringify.ts"; +export type { SchemaDefinition } from "./_yaml/schema.ts"; +export type { StyleVariant } from "./_yaml/type.ts"; export { CORE_SCHEMA, DEFAULT_SCHEMA, diff --git a/hash/_wasm/hash.ts b/hash/_wasm/hash.ts index d04a4d4a02b9..43ddf77f3c57 100644 --- a/hash/_wasm/hash.ts +++ b/hash/_wasm/hash.ts @@ -10,7 +10,7 @@ import init, { import * as hex from "../../encoding/hex.ts"; import * as base64 from "../../encoding/base64.ts"; -import { Hasher, Message, OutputFormat } from "../hasher.ts"; +import type { Hasher, Message, OutputFormat } from "../hasher.ts"; await init(source); diff --git a/hash/mod.ts b/hash/mod.ts index 946769f039ce..06c9ce4395b6 100644 --- a/hash/mod.ts +++ b/hash/mod.ts @@ -1,9 +1,9 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { Hash } from "./_wasm/hash.ts"; -import { Hasher } from "./hasher.ts"; +import type { Hasher } from "./hasher.ts"; -export { Hasher } from "./hasher.ts"; +export type { Hasher } from "./hasher.ts"; export type SupportedAlgorithm = | "md2" | "md4" diff --git a/io/ioutil.ts b/io/ioutil.ts index 3d9e72b569eb..ac6d103a3aa7 100644 --- a/io/ioutil.ts +++ b/io/ioutil.ts @@ -1,5 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { BufReader } from "./bufio.ts"; +import type { BufReader } from "./bufio.ts"; type Reader = Deno.Reader; type Writer = Deno.Writer; import { assert } from "../_util/assert.ts"; diff --git a/log/handlers.ts b/log/handlers.ts index 0efa7cc269d1..e09dc648c2e5 100644 --- a/log/handlers.ts +++ b/log/handlers.ts @@ -1,6 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { getLevelByName, LevelName, LogLevels } from "./levels.ts"; -import { LogRecord } from "./logger.ts"; +import type { LogRecord } from "./logger.ts"; import { red, yellow, blue, bold } from "../fmt/colors.ts"; import { existsSync, exists } from "../fs/exists.ts"; import { BufWriterSync } from "../io/bufio.ts"; diff --git a/log/logger.ts b/log/logger.ts index 05e83dc772d2..482047f2ac8b 100644 --- a/log/logger.ts +++ b/log/logger.ts @@ -5,7 +5,7 @@ import { getLevelName, LevelName, } from "./levels.ts"; -import { BaseHandler } from "./handlers.ts"; +import type { BaseHandler } from "./handlers.ts"; export interface LogRecordOptions { msg: string; diff --git a/log/mod.ts b/log/mod.ts index ed94725c4915..9565749aacd7 100644 --- a/log/mod.ts +++ b/log/mod.ts @@ -8,7 +8,7 @@ import { RotatingFileHandler, } from "./handlers.ts"; import { assert } from "../_util/assert.ts"; -import { LevelName } from "./levels.ts"; +import type { LevelName } from "./levels.ts"; export { LogLevels, LevelName } from "./levels.ts"; export { Logger } from "./logger.ts"; diff --git a/node/_fs/_fs_access.ts b/node/_fs/_fs_access.ts index ee93c4c7f039..79e4ca96db5e 100644 --- a/node/_fs/_fs_access.ts +++ b/node/_fs/_fs_access.ts @@ -1,6 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { CallbackWithError } from "./_fs_common.ts"; +import type { CallbackWithError } from "./_fs_common.ts"; import { notImplemented } from "../_utils.ts"; /** Revist once https://github.com/denoland/deno/issues/4017 lands */ diff --git a/node/_fs/_fs_chmod.ts b/node/_fs/_fs_chmod.ts index b1079e0a14f2..844afd21df18 100644 --- a/node/_fs/_fs_chmod.ts +++ b/node/_fs/_fs_chmod.ts @@ -1,6 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { CallbackWithError } from "./_fs_common.ts"; +import type { CallbackWithError } from "./_fs_common.ts"; import { fromFileUrl } from "../path.ts"; const allowedModes = /^[0-7]{3}/; diff --git a/node/_fs/_fs_chown.ts b/node/_fs/_fs_chown.ts index cd1973b1f78b..56068ef738f3 100644 --- a/node/_fs/_fs_chown.ts +++ b/node/_fs/_fs_chown.ts @@ -1,6 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { CallbackWithError } from "./_fs_common.ts"; +import type { CallbackWithError } from "./_fs_common.ts"; import { fromFileUrl } from "../path.ts"; /** diff --git a/node/_fs/_fs_close.ts b/node/_fs/_fs_close.ts index cdd815ad9ded..add6f6663eae 100644 --- a/node/_fs/_fs_close.ts +++ b/node/_fs/_fs_close.ts @@ -1,6 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { CallbackWithError } from "./_fs_common.ts"; +import type { CallbackWithError } from "./_fs_common.ts"; export function close(fd: number, callback: CallbackWithError): void { queueMicrotask(() => { diff --git a/node/_fs/_fs_copy.ts b/node/_fs/_fs_copy.ts index 26d9a8c9a26d..72f43d18fc51 100644 --- a/node/_fs/_fs_copy.ts +++ b/node/_fs/_fs_copy.ts @@ -1,6 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { CallbackWithError } from "./_fs_common.ts"; +import type { CallbackWithError } from "./_fs_common.ts"; import { fromFileUrl } from "../path.ts"; export function copyFile( diff --git a/node/_fs/_fs_dir_test.ts b/node/_fs/_fs_dir_test.ts index e8991277269e..2d2d5f5857de 100644 --- a/node/_fs/_fs_dir_test.ts +++ b/node/_fs/_fs_dir_test.ts @@ -1,6 +1,6 @@ import { assert, assertEquals, fail } from "../../testing/asserts.ts"; import Dir from "./_fs_dir.ts"; -import Dirent from "./_fs_dirent.ts"; +import type Dirent from "./_fs_dirent.ts"; Deno.test({ name: "Closing current directory with callback is successful", diff --git a/node/_fs/_fs_link.ts b/node/_fs/_fs_link.ts index 50916a7ba0d7..df08e13b1b6f 100644 --- a/node/_fs/_fs_link.ts +++ b/node/_fs/_fs_link.ts @@ -1,6 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { CallbackWithError } from "./_fs_common.ts"; +import type { CallbackWithError } from "./_fs_common.ts"; import { fromFileUrl } from "../path.ts"; /** diff --git a/node/_fs/_fs_mkdir.ts b/node/_fs/_fs_mkdir.ts index a65db8dba3d8..8578f465373b 100644 --- a/node/_fs/_fs_mkdir.ts +++ b/node/_fs/_fs_mkdir.ts @@ -1,5 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { CallbackWithError } from "./_fs_common.ts"; +import type { CallbackWithError } from "./_fs_common.ts"; import { fromFileUrl } from "../path.ts"; /** @@ -31,10 +31,11 @@ export function mkdir( if (options.recursive !== undefined) recursive = options.recursive; if (options.mode !== undefined) mode = options.mode; } - if (typeof recursive !== "boolean") + if (typeof recursive !== "boolean") { throw new Deno.errors.InvalidData( "invalid recursive option , must be a boolean" ); + } Deno.mkdir(path, { recursive, mode }) .then(() => { if (typeof callback === "function") { @@ -61,10 +62,11 @@ export function mkdirSync(path: string | URL, options?: MkdirOptions): void { if (options.recursive !== undefined) recursive = options.recursive; if (options.mode !== undefined) mode = options.mode; } - if (typeof recursive !== "boolean") + if (typeof recursive !== "boolean") { throw new Deno.errors.InvalidData( "invalid recursive option , must be a boolean" ); + } Deno.mkdirSync(path, { recursive, mode }); } diff --git a/node/_fs/_fs_writeFile_test.ts b/node/_fs/_fs_writeFile_test.ts index 3959ad219193..015ed65538c1 100644 --- a/node/_fs/_fs_writeFile_test.ts +++ b/node/_fs/_fs_writeFile_test.ts @@ -6,7 +6,7 @@ import { assertThrows, } from "../../testing/asserts.ts"; import { writeFile, writeFileSync } from "./_fs_writeFile.ts"; -import { TextEncodings } from "./_fs_common.ts"; +import type { TextEncodings } from "./_fs_common.ts"; import * as path from "../../path/mod.ts"; const testDataDir = path.resolve(path.join("node", "_fs", "testdata")); diff --git a/node/_fs/promises/_fs_readFile.ts b/node/_fs/promises/_fs_readFile.ts index 83ef9ac50d09..8677e05cd493 100644 --- a/node/_fs/promises/_fs_readFile.ts +++ b/node/_fs/promises/_fs_readFile.ts @@ -1,5 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { +import type { FileOptionsArgument, BinaryOptionsArgument, TextOptionsArgument, @@ -21,8 +21,9 @@ export function readFile( return new Promise((resolve, reject) => { readFileCallback(path, options, (err, data): void => { if (err) return reject(err); - if (data == null) + if (data == null) { return reject(new Error("Invalid state: data missing, but no error")); + } resolve(data); }); }); diff --git a/node/_fs/promises/_fs_writeFile.ts b/node/_fs/promises/_fs_writeFile.ts index 4f7c39a6a205..48b9bf0eaf2f 100644 --- a/node/_fs/promises/_fs_writeFile.ts +++ b/node/_fs/promises/_fs_writeFile.ts @@ -1,5 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { Encodings, WriteFileOptions } from "../_fs_common.ts"; +import type { Encodings, WriteFileOptions } from "../_fs_common.ts"; import { writeFile as writeFileCallback } from "../_fs_writeFile.ts"; diff --git a/node/_fs/promises/_fs_writeFile_test.ts b/node/_fs/promises/_fs_writeFile_test.ts index 8f6ef0842d5c..6901fff22e0d 100644 --- a/node/_fs/promises/_fs_writeFile_test.ts +++ b/node/_fs/promises/_fs_writeFile_test.ts @@ -6,7 +6,7 @@ import { assertThrowsAsync, } from "../../../testing/asserts.ts"; import { writeFile } from "./_fs_writeFile.ts"; -import { TextEncodings } from "../_fs_common.ts"; +import type { TextEncodings } from "../_fs_common.ts"; const decoder = new TextDecoder("utf-8"); diff --git a/path/_util.ts b/path/_util.ts index 8ae40373b219..0c325304520e 100644 --- a/path/_util.ts +++ b/path/_util.ts @@ -2,7 +2,7 @@ // Ported from https://github.com/browserify/path-browserify/ /** This module is browser compatible. */ -import { FormatInputPathObject } from "./_interface.ts"; +import type { FormatInputPathObject } from "./_interface.ts"; import { CHAR_UPPERCASE_A, CHAR_LOWERCASE_A, diff --git a/path/posix.ts b/path/posix.ts index 1e78d1cfe9ae..351ceb06ea22 100644 --- a/path/posix.ts +++ b/path/posix.ts @@ -2,7 +2,7 @@ // Ported from https://github.com/browserify/path-browserify/ /** This module is browser compatible. */ -import { FormatInputPathObject, ParsedPath } from "./_interface.ts"; +import type { FormatInputPathObject, ParsedPath } from "./_interface.ts"; import { CHAR_DOT, CHAR_FORWARD_SLASH } from "./_constants.ts"; import { diff --git a/path/win32.ts b/path/win32.ts index bac43a61a9a7..30482e453654 100644 --- a/path/win32.ts +++ b/path/win32.ts @@ -2,7 +2,7 @@ // Ported from https://github.com/browserify/path-browserify/ /** This module is browser compatible. */ -import { FormatInputPathObject, ParsedPath } from "./_interface.ts"; +import type { FormatInputPathObject, ParsedPath } from "./_interface.ts"; import { CHAR_DOT, CHAR_BACKWARD_SLASH, diff --git a/textproto/mod.ts b/textproto/mod.ts index f440ba5d50a0..1d0d22715a25 100644 --- a/textproto/mod.ts +++ b/textproto/mod.ts @@ -3,7 +3,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -import { BufReader } from "../io/bufio.ts"; +import type { BufReader } from "../io/bufio.ts"; import { concat } from "../bytes/mod.ts"; import { decode } from "../encoding/utf8.ts"; diff --git a/tsconfig_test.json b/tsconfig_test.json new file mode 100644 index 000000000000..1dbf69fb2ec2 --- /dev/null +++ b/tsconfig_test.json @@ -0,0 +1,5 @@ +{ + "compilerOptions": { + "importsNotUsedAsValues": "error" + } +}