Skip to content

Commit

Permalink
fix(examples): fix scope error in cli.ts
Browse files Browse the repository at this point in the history
Found by @HaveAGitGat: #136 (comment)

Enable eslint no-shadow rule.
  • Loading branch information
buzz committed Jul 31, 2023
1 parent 48cdcc3 commit cd044ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
// File extensions
"import/extensions": ["error", "never"],

"no-shadow": "warn",

"prettier/prettier": "error"
},
"overrides": [
Expand Down
6 changes: 3 additions & 3 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const analyze = async ({ coverData, file, format, full }: ReturnType<typeof pars
try {
fileHandle = await fsPromises.open(file, 'r')
fileSize = (await fileHandle.stat()).size
const mediainfo = await MediaInfoFactory({ format, coverData, full })
mediainfo = await MediaInfoFactory({ format, coverData, full })
if (mediainfo === undefined) {
throw new Error('Failed to initialize MediaInfo')
}
Expand Down Expand Up @@ -68,9 +68,9 @@ function parseArgs() {
.positional('file', { describe: 'File to analyze', type: 'string' })
.help('h')
.alias('h', 'help')
.fail(function (msg: string, err: Error, yargs) {
.fail((msg: string, err: Error, argv) => {
if (msg) {
console.error(yargs.help())
console.error(argv.help())
console.error(msg)
}
if (err) {
Expand Down

0 comments on commit cd044ff

Please sign in to comment.