Skip to content

Commit b8a4c93

Browse files
nonaraRon S
authored and
Ron S
committed
style: Prettier format
1 parent ad6959f commit b8a4c93

File tree

4 files changed

+27
-23
lines changed

4 files changed

+27
-23
lines changed

src/transformer.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// noinspection ES6UnusedImports
2-
import {} from 'ts-expose-internals';
3-
import path from 'path';
4-
import ts from 'typescript';
5-
import { cast } from './utils';
6-
import { TsTransformPathsConfig, TsTransformPathsContext, TypeScriptThree, VisitorContext } from './types';
7-
import { nodeVisitor } from './visitor';
8-
import { createHarmonyFactory } from './utils/harmony-factory';
9-
import { Minimatch } from 'minimatch';
2+
import {} from "ts-expose-internals";
3+
import path from "path";
4+
import ts from "typescript";
5+
import { cast } from "./utils";
6+
import { TsTransformPathsConfig, TsTransformPathsContext, TypeScriptThree, VisitorContext } from "./types";
7+
import { nodeVisitor } from "./visitor";
8+
import { createHarmonyFactory } from "./utils/harmony-factory";
9+
import { Minimatch } from "minimatch";
1010

1111
/* ****************************************************************************************************************** *
1212
* Transformer
@@ -48,15 +48,15 @@ export default function transformer(
4848
outputFileNamesCache: new Map(),
4949
// Get paths patterns appropriate for TS compiler version
5050
pathsPatterns: tryParsePatterns
51-
// TODO - Remove typecast when pathPatterns is recognized (probably after ts v4.4)
52-
? (configFile?.configFileSpecs as any)?.pathPatterns || tryParsePatterns(paths)
53-
: tsInstance.getOwnKeys(paths)
51+
? // TODO - Remove typecast when pathPatterns is recognized (probably after ts v4.4)
52+
(configFile?.configFileSpecs as any)?.pathPatterns || tryParsePatterns(paths)
53+
: tsInstance.getOwnKeys(paths),
5454
};
5555

5656
if (!tsTransformPathsContext.emitHost)
5757
throw new Error(
58-
`typescript-transform-paths >= 3.1.0 requires an EmitHost in the TransformationContext to resolve properly.`
59-
+ ` Make sure you're using either ts-patch or ttypescript.`
58+
`typescript-transform-paths >= 3.1.0 requires an EmitHost in the TransformationContext to resolve properly.` +
59+
` Make sure you're using either ts-patch or ttypescript.`
6060
);
6161

6262
return (sourceFile: ts.SourceFile) => {

src/types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import tsThree from './declarations/typescript3';
1+
import tsThree from "./declarations/typescript3";
22
import ts, { CompilerOptions, EmitHost, GetCanonicalFileName, Pattern, SourceFile } from "typescript";
3-
import { PluginConfig } from 'ts-patch';
4-
import { HarmonyFactory } from './utils/harmony-factory';
5-
import { IMinimatch } from 'minimatch';
3+
import { PluginConfig } from "ts-patch";
4+
import { HarmonyFactory } from "./utils/harmony-factory";
5+
import { IMinimatch } from "minimatch";
66

77
/* ****************************************************************************************************************** */
88
// region: TS Types

src/utils/resolve-module-name.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { VisitorContext } from '../types';
2-
import { isBaseDir, isURL, maybeAddRelativeLocalPrefix } from './general-utils';
3-
import * as path from 'path';
4-
import { removeFileExtension, removeSuffix, ResolvedModuleFull, SourceFile } from 'typescript';
5-
import { getOutputDirForSourceFile } from './ts-helpers';
1+
import { VisitorContext } from "../types";
2+
import { isBaseDir, isURL, maybeAddRelativeLocalPrefix } from "./general-utils";
3+
import * as path from "path";
4+
import { removeFileExtension, removeSuffix, ResolvedModuleFull, SourceFile } from "typescript";
5+
import { getOutputDirForSourceFile } from "./ts-helpers";
66

77
/* ****************************************************************************************************************** */
88
// region: Types

src/utils/ts-helpers.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ export function getOutputDirForSourceFile(context: VisitorContext, sourceFile: S
2020

2121
if (outputFileNamesCache.has(sourceFile)) return outputFileNamesCache.get(sourceFile)!;
2222

23-
const outputPath = getOwnEmitOutputFilePath(sourceFile.fileName, emitHost, getOutputExtension(sourceFile, compilerOptions));
23+
const outputPath = getOwnEmitOutputFilePath(
24+
sourceFile.fileName,
25+
emitHost,
26+
getOutputExtension(sourceFile, compilerOptions)
27+
);
2428
if (!outputPath)
2529
throw new Error(
2630
`Could not resolve output path for ${sourceFile.fileName}. Please report a GH issue at: ` +

0 commit comments

Comments
 (0)