Skip to content

Commit 20d05b5

Browse files
authored
Merge pull request #167 from msgpack/importsNotUsedAsValues
importsNotUsedAsValues: error; the most strict way to control imports
2 parents f97f921 + f46d1a2 commit 20d05b5

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

src/Encoder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { utf8EncodeJs, utf8Count, TEXT_ENCODER_THRESHOLD, utf8EncodeTE } from ".
22
import { ExtensionCodec, ExtensionCodecType } from "./ExtensionCodec";
33
import { setInt64, setUint64 } from "./utils/int";
44
import { ensureUint8Array } from "./utils/typedArrays";
5-
import { ExtData } from "./ExtData";
5+
import type { ExtData } from "./ExtData";
66

77
export const DEFAULT_MAX_DEPTH = 100;
88
export const DEFAULT_INITIAL_BUFFER_SIZE = 2048;

src/decode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { ExtensionCodecType } from "./ExtensionCodec";
21
import { Decoder } from "./Decoder";
3-
import { ContextOf, SplitUndefined } from "./context";
2+
import type { ExtensionCodecType } from "./ExtensionCodec";
3+
import type { ContextOf, SplitUndefined } from "./context";
44

55
export type DecodeOptions<ContextType = undefined> = Readonly<
66
Partial<{

src/encode.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { ExtensionCodecType } from "./ExtensionCodec";
21
import { Encoder } from "./Encoder";
3-
import { ContextOf, SplitUndefined } from "./context";
2+
import type { ExtensionCodecType } from "./ExtensionCodec";
3+
import type { ContextOf, SplitUndefined } from "./context";
44

55
export type EncodeOptions<ContextType = undefined> = Partial<
66
Readonly<{

test/decode-max-length.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import assert from "assert";
22
import { encode, decode, decodeAsync } from "../src";
3-
import { DecodeOptions } from "../src/decode";
3+
import type { DecodeOptions } from "../src/decode";
44

55
describe("decode with max${Type}Length specified", () => {
66
async function* createStream<T>(input: T) {

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
4040
"noUncheckedIndexedAccess": true,
4141
"noPropertyAccessFromIndexSignature": true,
42+
"importsNotUsedAsValues": "error",
4243

4344
/* Module Resolution Options */
4445
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */

0 commit comments

Comments
 (0)