Skip to content

Commit f04ac77

Browse files
authored
refactor: remove hardcoded types (#240)
1 parent 0ab8ebc commit f04ac77

File tree

5 files changed

+20
-67
lines changed

5 files changed

+20
-67
lines changed

eslint.config.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import tseslint from "typescript-eslint";
44

55
export default [
66
{ files: ["**/*.{js,mjs,cjs,ts}"] },
7-
{ ignores: ["**/dist/", "test/projects/", "types/"] },
7+
{ ignores: ["**/dist/", "test/projects/"] },
88
{ languageOptions: { globals: globals.node } },
99
pluginJs.configs.recommended,
1010
...tseslint.configs.recommended,

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "3.4.10",
44
"description": "Transforms module resolution paths using TypeScript path mapping and/or custom paths",
55
"main": "dist/index.js",
6-
"types": "types/index.d.ts",
6+
"types": "dist/index.d.ts",
77
"scripts": {
88
"compile": "tsc",
99
"build": "yarn clean && yarn compile",

src/plugins/nx-transformer-plugin.ts

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
1-
import { NxTransformerPlugin } from "../../types";
21
import transformer from "../transformer";
32
import ts from "typescript";
43

4+
export interface TsTransformPathsConfig {
5+
readonly useRootDirs?: boolean;
6+
readonly exclude?: string[];
7+
readonly afterDeclarations?: boolean;
8+
readonly tsConfig?: string;
9+
readonly transform?: string;
10+
}
11+
12+
export type NxTransformerFactory = (
13+
config?: Omit<TsTransformPathsConfig, "transform">,
14+
program?: ts.Program,
15+
) => ts.TransformerFactory<ts.SourceFile>;
16+
17+
export interface NxTransformerPlugin {
18+
before: NxTransformerFactory;
19+
afterDeclarations: NxTransformerFactory;
20+
}
21+
522
/* ****************************************************************************************************************** *
623
* Locals
724
* ****************************************************************************************************************** */

types/index.d.ts

-50
This file was deleted.

types/register.d.ts

-14
This file was deleted.

0 commit comments

Comments
 (0)