Skip to content

Commit 50b1767

Browse files
committed
fix: resolve typescript warnings
1 parent f930785 commit 50b1767

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

packages/coreui-vue/src/components/dropdown/utils.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import type { Placement } from '@popperjs/core'
22
import type { Placements } from '../../types'
3-
import type { Alignments } from './types'
3+
import type { Alignments, Breakpoints } from './types'
44

5-
export const getAlignmentClassNames = (alignment: object | string) => {
5+
export const getAlignmentClassNames = (alignment: Alignments) => {
66
const classNames: string[] = []
77
if (typeof alignment === 'object') {
8-
Object.keys(alignment).map((key) => {
9-
classNames.push(`dropdown-menu${key === 'xs' ? '' : `-${key}`}-${alignment[key]}`)
10-
})
8+
for (const key in alignment) {
9+
classNames.push(
10+
`dropdown-menu${key === 'xs' ? '' : `-${key}`}-${alignment[key as keyof Breakpoints]}`,
11+
)
12+
}
1113
}
1214

1315
if (typeof alignment === 'string') {

packages/coreui-vue/src/index.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
import { App } from 'vue'
23
import * as Components from './components'
34
import * as Directives from './directives'
45

56
const CoreuiVue = {
67
install: (app: App): void => {
78
for (const key in Components) {
8-
app.component(key, Components[key])
9+
app.component(key, (Components as { [key: string]: any })[key])
910
}
1011

1112
for (const key in Directives) {
12-
app.directive(Directives[key]['name'], Directives[key])
13+
app.directive(
14+
(Directives as { [key: string]: any })[key]['name'],
15+
(Directives as { [key: string]: any })[key],
16+
)
1317
}
1418
},
1519
}

tsconfig.json

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"noImplicitThis": true,
1616
"noImplicitAny": true,
1717
"strictNullChecks": true,
18-
"suppressImplicitAnyIndexErrors": true,
1918
"noUnusedLocals": true,
2019
"noUnusedParameters": true,
2120
"esModuleInterop": true,

0 commit comments

Comments
 (0)