diff --git a/src/commands/schema/generate.ts b/src/commands/schema/generate.ts index aae4dd08..6887b557 100644 --- a/src/commands/schema/generate.ts +++ b/src/commands/schema/generate.ts @@ -110,10 +110,10 @@ export class SchemaGenerator { // eslint-disable-next-line unicorn/no-array-reduce const hookFiles = Object.values(this.base.config.pjson.oclif?.hooks ?? {}).reduce( (x: string[], y: string | string[]) => (Array.isArray(y) ? [...x, ...y] : [...x, y]), - [] as string[], + [], ) const {outDir, rootDir} = this.getDirs() - return (hookFiles as string[]).map((h) => `${path.resolve(h)}.ts`.replace(outDir, rootDir)) + return hookFiles.map((h) => `${path.resolve(h)}.ts`.replace(outDir, rootDir)) } private getDirs(): {outDir: string; rootDir: string} { diff --git a/src/commands/snapshot/compare.ts b/src/commands/snapshot/compare.ts index f9bc9586..865bb7fe 100644 --- a/src/commands/snapshot/compare.ts +++ b/src/commands/snapshot/compare.ts @@ -187,7 +187,7 @@ export default class Compare extends SnapshotCommand { public async run(): Promise { const {flags} = await this.parse(Compare) - const oldCommands = JSON.parse(fs.readFileSync(flags.filepath).toString('utf8')) as SnapshotEntry[] + const oldCommands = JSON.parse(fs.readFileSync(flags.filepath, 'utf8')) as SnapshotEntry[] const newCommands = this.changed return this.compareSnapshot(oldCommands, newCommands) }