diff --git a/src/check-tsconfig.ts b/src/check-tsconfig.ts index 0a487342..7bea3944 100644 --- a/src/check-tsconfig.ts +++ b/src/check-tsconfig.ts @@ -1,6 +1,7 @@ -import { tsModule } from "./tsproxy"; import * as tsTypes from "typescript"; +import { tsModule } from "./tsproxy"; + export function checkTsConfig(parsedConfig: tsTypes.ParsedCommandLine): void { const module = parsedConfig.options.module!; diff --git a/src/diagnostics-format-host.ts b/src/diagnostics-format-host.ts index c9908661..c8d39bbd 100644 --- a/src/diagnostics-format-host.ts +++ b/src/diagnostics-format-host.ts @@ -1,5 +1,6 @@ import * as path from "path"; import * as tsTypes from "typescript"; + import { tsModule } from "./tsproxy"; export class FormatHost implements tsTypes.FormatDiagnosticsHost diff --git a/src/get-options-overrides.ts b/src/get-options-overrides.ts index 86617617..2f9e6621 100644 --- a/src/get-options-overrides.ts +++ b/src/get-options-overrides.ts @@ -1,8 +1,9 @@ +import * as path from "path"; +import * as tsTypes from "typescript"; import { createFilter as createRollupFilter, normalizePath as normalize } from "@rollup/pluginutils"; + import { tsModule } from "./tsproxy"; -import * as tsTypes from "typescript"; import { IOptions } from "./ioptions"; -import * as path from "path"; import { IContext } from "./context"; export function getOptionsOverrides({ useTsconfigDeclarationDir, cacheRoot }: IOptions, preParsedTsconfig?: tsTypes.ParsedCommandLine): tsTypes.CompilerOptions diff --git a/src/host.ts b/src/host.ts index a0831635..484959d0 100644 --- a/src/host.ts +++ b/src/host.ts @@ -1,6 +1,7 @@ -import { tsModule } from "./tsproxy"; import * as tsTypes from "typescript"; import { normalizePath as normalize } from "@rollup/pluginutils"; + +import { tsModule } from "./tsproxy"; import { TransformerFactoryCreator } from "./ioptions"; export class LanguageServiceHost implements tsTypes.LanguageServiceHost diff --git a/src/index.ts b/src/index.ts index 686374a3..bca56173 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,22 +1,21 @@ +import { relative, dirname, normalize as pathNormalize, resolve as pathResolve } from "path"; +import * as tsTypes from "typescript"; +import { PluginImpl, PluginContext, InputOptions, OutputOptions, TransformResult, SourceMap, Plugin } from "rollup"; +import { normalizePath as normalize } from "@rollup/pluginutils"; +import * as _ from "lodash"; +import { blue, red, yellow, green } from "colors/safe"; +import * as resolve from "resolve"; +import findCacheDir from "find-cache-dir"; + import { RollupContext } from "./rollupcontext"; import { ConsoleContext, VerbosityLevel } from "./context"; import { LanguageServiceHost } from "./host"; import { TsCache, convertDiagnostic, convertEmitOutput, getAllReferences } from "./tscache"; import { tsModule, setTypescriptModule } from "./tsproxy"; -import * as tsTypes from "typescript"; -import * as resolve from "resolve"; -import * as _ from "lodash"; import { IOptions } from "./ioptions"; import { parseTsConfig } from "./parse-tsconfig"; import { printDiagnostics } from "./print-diagnostics"; import { TSLIB, TSLIB_VIRTUAL, tslibSource, tslibVersion } from "./tslib"; -import { blue, red, yellow, green } from "colors/safe"; -import { relative, dirname, normalize as pathNormalize, resolve as pathResolve } from "path"; -import { normalizePath as normalize } from "@rollup/pluginutils"; -import findCacheDir from "find-cache-dir"; - -import { PluginImpl, PluginContext, InputOptions, OutputOptions, TransformResult, SourceMap, Plugin } from "rollup"; - import { createFilter } from "./get-options-overrides"; type RPT2Options = Partial; diff --git a/src/ioptions.ts b/src/ioptions.ts index 5fe3b6e3..1f7ad458 100644 --- a/src/ioptions.ts +++ b/src/ioptions.ts @@ -1,6 +1,7 @@ -import { tsModule } from "./tsproxy"; import * as tsTypes from "typescript"; +import { tsModule } from "./tsproxy"; + export interface ICustomTransformer { before?: tsTypes.TransformerFactory; diff --git a/src/parse-tsconfig.ts b/src/parse-tsconfig.ts index f2152a8f..8fb39f5c 100644 --- a/src/parse-tsconfig.ts +++ b/src/parse-tsconfig.ts @@ -1,11 +1,12 @@ +import { dirname } from "path"; +import * as _ from "lodash"; + import { tsModule } from "./tsproxy"; import { IContext } from "./context"; -import { dirname } from "path"; import { printDiagnostics } from "./print-diagnostics"; import { convertDiagnostic } from "./tscache"; import { getOptionsOverrides } from "./get-options-overrides"; import { IOptions } from "./ioptions"; -import * as _ from "lodash"; import { checkTsConfig } from "./check-tsconfig"; export function parseTsConfig(context: IContext, pluginOptions: IOptions) diff --git a/src/print-diagnostics.ts b/src/print-diagnostics.ts index 9185ca39..770d140c 100644 --- a/src/print-diagnostics.ts +++ b/src/print-diagnostics.ts @@ -1,5 +1,6 @@ -import { tsModule } from "./tsproxy"; import { red, white, yellow } from "colors/safe"; + +import { tsModule } from "./tsproxy"; import { IContext } from "./context"; import { IDiagnostics } from "./tscache"; diff --git a/src/rollingcache.ts b/src/rollingcache.ts index 2c69d779..ba0ca42b 100644 --- a/src/rollingcache.ts +++ b/src/rollingcache.ts @@ -1,8 +1,9 @@ -import { ICache } from "./icache"; -import { emptyDirSync, ensureFileSync, readJsonSync, removeSync, writeJsonSync } from "fs-extra"; import { existsSync, readdirSync, renameSync } from "fs"; +import { emptyDirSync, ensureFileSync, readJsonSync, removeSync, writeJsonSync } from "fs-extra"; import * as _ from "lodash"; +import { ICache } from "./icache"; + /** * Saves data in new cache folder or reads it from old one. * Avoids perpetually growing cache and situations when things need to consider changed and then reverted data to be changed. diff --git a/src/rollupcontext.ts b/src/rollupcontext.ts index 28a876be..9ab52371 100644 --- a/src/rollupcontext.ts +++ b/src/rollupcontext.ts @@ -1,7 +1,8 @@ -import { IContext, VerbosityLevel } from "./context"; import * as _ from "lodash"; import { PluginContext } from "rollup"; +import { IContext, VerbosityLevel } from "./context"; + export class RollupContext implements IContext { private hasContext: boolean = true; diff --git a/src/tscache.ts b/src/tscache.ts index 2913e947..c4195a56 100644 --- a/src/tscache.ts +++ b/src/tscache.ts @@ -1,13 +1,14 @@ -import { IContext } from "./context"; +import * as tsTypes from "typescript"; +import { emptyDirSync, pathExistsSync, readdirSync, removeSync, statSync } from "fs-extra"; +import * as _ from "lodash"; import { Graph, alg } from "graphlib"; import hash from "object-hash"; +import { blue, yellow, green } from "colors/safe"; + +import { IContext } from "./context"; import { RollingCache } from "./rollingcache"; import { ICache } from "./icache"; -import * as _ from "lodash"; import { tsModule } from "./tsproxy"; -import * as tsTypes from "typescript"; -import { blue, yellow, green } from "colors/safe"; -import { emptyDirSync, pathExistsSync, readdirSync, removeSync, statSync } from "fs-extra"; import { formatHost } from "./diagnostics-format-host"; import { NoCache } from "./nocache";