Skip to content

Commit 1c4172a

Browse files
committed
resolving eslint issues
1 parent 21deb42 commit 1c4172a

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
],
66
"rules": {
77
"unicorn/no-abusive-eslint-disable": "off",
8-
"@typescript-eslint/no-use-before-define": "off"
8+
"@typescript-eslint/no-use-before-define": "off",
9+
"@typescript-eslint/ban-ts-ignore": "off"
910
}
1011
}

src/commands/content-type/compare.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ export default class CompareCommand extends Command {
5151
const {flags} = this.parse(CompareCommand)
5252
this.setup(flags)
5353

54-
const [stack, previous, current] = await Promise.all
55-
([
54+
const [stack, previous, current] = await Promise.all([
5655
this.client.getStack(this.apiKey),
5756
this.client.getContentType(this.apiKey, flags['content-type'], true, flags.left),
5857
this.client.getContentType(this.apiKey, flags['content-type'], true, flags.right),

src/commands/content-type/details.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ export default class DetailsCommand extends Command {
3737
const {flags} = this.parse(DetailsCommand)
3838
this.setup(flags)
3939

40-
const [stack, contentType, references] = await Promise.all
41-
([
40+
const [stack, contentType, references] = await Promise.all([
4241
this.client.getStack(this.apiKey),
4342
this.client.getContentType(this.apiKey, flags['content-type'], true),
4443
this.client.getContentTypeReferences(this.apiKey, flags['content-type']),

src/core/content-type/compare.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default async function buildOutput(contentTypeName: string, previous: any
1515
matching: 'lines',
1616
})
1717

18-
await tmp.file({prefix: `${contentTypeName}-compare`, postfix: '.html', keep: true}, async function (err: any, path: any, fd: any, cleanupCallback: any) {
18+
await tmp.file({prefix: `${contentTypeName}-compare`, postfix: '.html', keep: true}, async function (err: any, path: any, _fd: any, _cleanupCallback: any) {
1919
if (err) throw err
2020
fs.writeFileSync(path, html(diffHtml))
2121
await cli.open(path)

src/core/content-type/details.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function processFields(schema: any, parent = null, depth = 0, prefix = ''): any
4949
}
5050

5151
function buildRow(field: any, parent = null, depth = 0, prefix = '') {
52-
const dots = '.'.repeat(depth == 0 ? 0 : depth * 2)
52+
const dots = '.'.repeat(depth === 0 ? 0 : depth * 2)
5353
const displayName = `${prefix ? dots : ''}${parent ? '[' + parent + '] ' : ''}${field.display_name}`
5454
const path = `${prefix ? prefix + '.' : ''}${field.uid}`
5555

@@ -69,7 +69,7 @@ function buildHeader(contentType: any, references: string[]) {
6969
const details = []
7070

7171
result.push(`Description: ${contentType.description ? contentType.description : 'None'}`)
72-
result.push(`Referenced By: ${references.length ? references.join(', ') : 'None'}\n`)
72+
result.push(`Referenced By: ${references.length > 0 ? references.join(', ') : 'None'}\n`)
7373

7474
details.push(['Type', 'Multiple', 'URL Pattern', 'Created', 'Modified', 'Version'])
7575

src/core/content-type/formatting.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export function date(date: any) {
88
}
99

1010
export function fullName(users: any, uid: string) {
11-
if (!users || users.length == 0) return 'Unknown'
12-
const user = users.find((u: any) => u.uid == uid)
11+
if (!users || users.length === 0) return 'Unknown'
12+
const user = users.find((u: any) => u.uid === uid)
1313
if (!user) return 'Unknown'
1414
return `${user.first_name} ${user.last_name}`
1515
}

0 commit comments

Comments
 (0)