Skip to content

Commit

Permalink
fix: lint issue (#14)
Browse files Browse the repository at this point in the history
* should fix release CI
  • Loading branch information
Bugs5382 committed Dec 30, 2023
2 parents e06f9f7 + af47e12 commit 86dd281
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"@types/yargs": "^17.0.32",
"clean-publish": "^4.2.0",
"npm-package-json-lint": "^7.1.0",
"precommit": "^1.2.2",
"semantic-release": "^22.0.12",
"snazzy": "^9.0.0",
"ts-node": "^10.9.2",
Expand All @@ -83,5 +84,8 @@
"lodash": "^4.17.21",
"pino": "^8.17.2",
"pino-pretty": "^10.3.1"
}
},
"precommit": [
"lint:fix"
]
}
4 changes: 2 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ export const DEFAULT_NPM = {
}
}

export const CLI_PROGRESS = (area: string) => {
export const CLI_PROGRESS = (area: string): any => {
return {
format: `${area} {bar}\u25A0 {percentage}% | ETA: {eta}s | {value}/{total}`,
barCompleteChar: '\u25A0',
barIncompleteChar: ' '
}
};
}
2 changes: 1 addition & 1 deletion src/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import cliProgress from 'cli-progress'
import fs from 'fs'
import path from 'node:path'
import {CLI_PROGRESS} from "./constants.js";
import { CLI_PROGRESS } from './constants.js'
import { TemplateCopyOptions } from './types.js'

/**
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const main = async (): Promise<void> => {
type: 'input',
name: 'repoName',
message: 'Project Name:',
default: npmName || defaultProjectName,
default: typeof npmName !== 'undefined' ? npmName : '',
when: (answers) => answers.gitLocation === 'github'
}, {
type: 'input',
Expand Down Expand Up @@ -135,9 +135,9 @@ export const main = async (): Promise<void> => {
const temp: string = process.env.NODE_ENV === 'test' ? 'temp/' : ''

// create folder
let cwd: string = process.cwd()
let folder = typeof npmName !== 'undefined' ? npmName : npm
cwd = path.join(process.cwd(), `${temp}/${folder}`)

const folder: string = typeof npmName !== 'undefined' ? npmName : npm
let cwd = path.join(process.cwd(), `${temp}/${folder}`)
fs.mkdirSync(cwd, { recursive: true })
process.chdir(cwd)

Expand Down
4 changes: 2 additions & 2 deletions src/npm.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import childProcess from 'node:child_process'
import { promisify } from 'node:util'
import cliProgress from 'cli-progress'
import {CLI_PROGRESS} from "./constants.js";
import { CLI_PROGRESS } from './constants.js'
import {
GeneratePackageJsonInputWithOptions,
GeneratePackageJsonParams
Expand Down Expand Up @@ -148,7 +148,7 @@ export const installDeps = async (dependencies: string[], options: { dev?: boole
}

if (dependencies.length > 0) {
const bar = new cliProgress.SingleBar({}, CLI_PROGRESS(options.dev === true ? 'NPM DEV': 'NPM'))
const bar = new cliProgress.SingleBar({}, CLI_PROGRESS(options.dev === true ? 'NPM DEV' : 'NPM'))
bar.start(dependencies.length, 0)

let value = 0
Expand Down

0 comments on commit 86dd281

Please sign in to comment.