diff --git a/src/index.ts b/src/index.ts index 887bafb..db9bde3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,10 +9,15 @@ import getRestructureMap from "./index/getFilePaths"; const { argv } = process; -export type Options = { - help: boolean; - version: boolean; - write: boolean; +type Options = { + help: boolean, + version: boolean, + write: boolean, +}; + +type Args = { + options: Partial, + rootPaths: string[], }; const defaultOptions: Options = { @@ -43,10 +48,8 @@ const printHelp = (exitCode: number) => { return process.exit(exitCode); }; -const parseArgs = ( - args: any[] -): { options: Partial; rootPaths: string[] } => - args.reduce( +const parseArgs = (args: string[]): Args => + args.reduce( (acc, arg) => { switch (arg) { case "-h": diff --git a/src/index/generateTrees/printTree.ts b/src/index/generateTrees/printTree.ts index 46e0955..3fcd2a4 100644 --- a/src/index/generateTrees/printTree.ts +++ b/src/index/generateTrees/printTree.ts @@ -2,7 +2,7 @@ import chalk from "chalk"; import logger from "../../shared/logger"; -type PositionedLeaf = { text: string; position: number }; +type PositionedLeaf = { text: string, position: number }; const createBranchFromParts = (parts: string[], count: number) => parts.slice(0, count).join("/"); diff --git a/src/index/generateTrees/shared/Graph.ts b/src/index/generateTrees/shared/Graph.ts index 47c47e6..e56aa9b 100644 --- a/src/index/generateTrees/shared/Graph.ts +++ b/src/index/generateTrees/shared/Graph.ts @@ -1,5 +1,5 @@ export type Graph = Record; export type OldGraph = Record< string, - { oldLocation: string; imports: Array<{ text: string; resolved: string }> } + { oldLocation: string, imports: { text: string, resolved: string }[] } >; diff --git a/src/index/shared/RootOption.ts b/src/index/shared/RootOption.ts index 3869e7d..752b4e1 100644 --- a/src/index/shared/RootOption.ts +++ b/src/index/shared/RootOption.ts @@ -1,5 +1,5 @@ export type RootOption = { - parentFolder: string; - tree: Record; - useForwardSlash: boolean; + parentFolder: string, + tree: Record, + useForwardSlash: boolean, };