Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export default [
rules: {
"@typescript-eslint/no-empty-object-type": ["error", { allowInterfaces: "with-single-extends" }],
"@typescript-eslint/no-namespace": ["error", { allowDeclarations: true }],
"@typescript-eslint/no-import-type-side-effects": "error",
"@typescript-eslint/consistent-type-imports": ["error", { fixStyle: "inline-type-imports" }],
"no-empty": ["error", { allowEmptyCatch: true }],
"prefer-const": ["error", { destructuring: "all" }],
},
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/nx.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// See nx-transformer-plugin.ts
// https://github.com/nrwl/nx/blob/229f71ef1758ee625869aaa6fa6355dc3284fa5b/packages/js/src/utils/typescript/types.ts#L19-L32
// https://github.com/nrwl/nx/blob/master/packages/js/src/utils/typescript/load-ts-transformers.ts
import ts from "typescript";
import type ts from "typescript";

import transformer from "../transformer.ts";

Expand Down
7 changes: 4 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Minimatch } from "minimatch";
import { type PluginConfig } from "ts-patch";
import ts, { type CompilerOptions, type EmitHost, type Pattern, type SourceFile } from "typescript";
import type { Minimatch } from "minimatch";
import type { PluginConfig } from "ts-patch";
import type ts from "typescript";
import type { CompilerOptions, EmitHost, Pattern, SourceFile } from "typescript";

/* ****************************************************************************************************************** */
// region: TS Types
Expand Down
2 changes: 1 addition & 1 deletion src/utils/resolve-module-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as path from "node:path";

import { removeFileExtension, removeSuffix, type ResolvedModuleFull, type SourceFile } from "typescript";

import { type VisitorContext } from "../types.ts";
import type { VisitorContext } from "../types.ts";
import { isBaseDir, isURL, maybeAddRelativeLocalPrefix } from "./general-utils.ts";
import { getRelativePath } from "./get-relative-path.ts";
import { getOutputDirForSourceFile } from "./ts-helpers.ts";
Expand Down
4 changes: 2 additions & 2 deletions src/utils/resolve-path-update-node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ts from "typescript";
import type ts from "typescript";

import { type VisitorContext } from "../types.ts";
import type { VisitorContext } from "../types.ts";
import { isURL, maybeAddRelativeLocalPrefix } from "./general-utils.ts";
import { resolveModuleName } from "./resolve-module-name.ts";
import { isModulePathsMatch } from "./ts-helpers.ts";
Expand Down
5 changes: 3 additions & 2 deletions src/utils/ts-helpers.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import path from "node:path";

import type { REGISTER_INSTANCE } from "ts-node";
import ts, { type GetCanonicalFileName, type SourceFile } from "typescript";
import type ts from "typescript";
import type { GetCanonicalFileName, SourceFile } from "typescript";

import { type VisitorContext } from "../types.ts";
import type { VisitorContext } from "../types.ts";

/* ****************************************************************************************************************** */
// region: TS Helpers
Expand Down
4 changes: 2 additions & 2 deletions src/visitor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ts from "typescript";
import type ts from "typescript";

import { type VisitorContext } from "./types.ts";
import type { VisitorContext } from "./types.ts";
import { elideImportOrExportDeclaration, resolvePathAndUpdateNode } from "./utils/index.ts";

const isAsyncImport = ({ tsInstance }: VisitorContext, node: ts.Node): node is ts.CallExpression =>
Expand Down
2 changes: 1 addition & 1 deletion test/tests/transformer/general.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import * as path from "node:path";
import { before, describe, test } from "node:test";

import { projectsPaths, ts, tsModules } from "../../config.ts";
import { projectsPaths, type ts, tsModules } from "../../config.ts";
import { createTsProgram, getEmitResultFromProgram, type EmittedFiles } from "../../utils/index.ts";

/* ****************************************************************************************************************** *
Expand Down
4 changes: 2 additions & 2 deletions test/tests/transformer/specific.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import assert from "node:assert";
import * as path from "node:path";
import { before, describe, test } from "node:test";

import TS from "typescript";
import type TS from "typescript";

import { type TsTransformPathsConfig } from "typescript-transform-paths";
import type { TsTransformPathsConfig } from "typescript-transform-paths";

import { projectsPaths, ts, tsModules } from "../../config.ts";
import {
Expand Down
2 changes: 1 addition & 1 deletion test/utils/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from "node:fs";

import ts from "typescript";
import type ts from "typescript";
import { default as tstpTransform, type TsTransformPathsConfig } from "typescript-transform-paths";

import * as config from "../config.ts";
Expand Down
Loading