Skip to content

Commit

Permalink
chore(deps): update typescript-eslint monorepo to v8
Browse files Browse the repository at this point in the history
Fixes or ignores some new lint errors caught by typescript-eslint v8
  • Loading branch information
renovate[bot] authored and cexbrayat committed Aug 1, 2024
1 parent 9d0a618 commit a997575
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 69 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"@rollup/plugin-typescript": "11.1.6",
"@types/js-beautify": "1.14.3",
"@types/node": "20.14.13",
"@typescript-eslint/eslint-plugin": "7.18.0",
"@typescript-eslint/parser": "7.18.0",
"@typescript-eslint/eslint-plugin": "8.0.0",
"@typescript-eslint/parser": "8.0.0",
"@vitejs/plugin-vue": "5.1.1",
"@vitejs/plugin-vue-jsx": "4.0.0",
"@vitest/coverage-v8": "2.0.5",
Expand Down
121 changes: 60 additions & 61 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions src/createDomEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import domEvents, {
} from './constants/dom-events'

interface TriggerOptions {
code?: String
key?: String
keyCode?: Number
code?: string
key?: string
keyCode?: number
[custom: string]: any
}

Expand Down Expand Up @@ -156,7 +156,7 @@ function createDOMEvent(
const eventPrototype = Object.getPrototypeOf(event)

// attach custom options to the event, like `relatedTarget` and so on.
options &&
if (options) {
Object.keys(options).forEach((key) => {
const propertyDescriptor = Object.getOwnPropertyDescriptor(
eventPrototype,
Expand All @@ -169,6 +169,7 @@ function createDOMEvent(
event[key] = options[key]
}
})
}
return event
}

Expand Down
3 changes: 3 additions & 0 deletions src/createInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ function getInstanceOptions(

// implementation
export function createInstance(
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
inputComponent: DefineComponent<{}, {}, any, any, any, any>,
options?: MountingOptions<any> & Record<string, any>
) {
Expand Down Expand Up @@ -129,8 +130,10 @@ export function createInstance(
options?.slots &&
Object.entries(options.slots).reduce(
(
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
acc: { [key: string]: Function },
[name, slot]: [string, Slot]
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
): { [key: string]: Function } => {
if (Array.isArray(slot)) {
const normalized = slot.map(slotToFunction)
Expand Down
1 change: 1 addition & 0 deletions src/mount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type ShimSlotReturnType<T> = T extends (...args: infer P) => any

type WithArray<T> = T | T[]

// eslint-disable-next-line @typescript-eslint/no-empty-object-type
type ComponentData<T> = T extends { data?(...args: any): infer D } ? D : {}

export type ComponentMountingOptions<
Expand Down
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-empty-object-type */
import {
Component,
ComponentOptions,
Expand Down Expand Up @@ -27,6 +28,7 @@ export type FindAllComponentsSelector =
| string
export type FindComponentSelector = RefSelector | FindAllComponentsSelector

// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
export type Slot = VNode | string | { render: Function } | Function | Component

type SlotDictionary = {
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ export function textContent(element: Node): string {
: ''
}

export function hasOwnProperty<O extends {}, P extends PropertyKey>(
export function hasOwnProperty<O extends object, P extends PropertyKey>(
obj: O,
prop: P
): obj is O & Record<P, unknown> {
return obj.hasOwnProperty(prop)
}

export function isNotNullOrUndefined<T extends {}>(
export function isNotNullOrUndefined<T extends object>(
obj: T | null | undefined
): obj is T {
return Boolean(obj)
Expand Down
2 changes: 2 additions & 0 deletions src/utils/vueCompatSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ function isCompatEnabled(key: string): boolean {
}

export function isLegacyExtendedComponent(component: unknown): component is {
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
(): Function
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
super: Function
options: ComponentOptions
} {
Expand Down

0 comments on commit a997575

Please sign in to comment.