Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meta: use explicit-module-boundary-types instead of `explicit-funct… #4858

Merged
merged 3 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ module.exports = {
files: ['packages/@uppy/*/src/**/*.ts', 'packages/@uppy/*/src/**/*.tsx'],
excludedFiles: ['packages/@uppy/**/*.test.ts', 'packages/@uppy/core/src/mocks/*.ts'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'error',
},
},
{
Expand Down
4 changes: 2 additions & 2 deletions packages/@uppy/core/src/BasePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import Translator from '@uppy/utils/lib/Translator'
import type { I18n, Locale } from '@uppy/utils/lib/Translator'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import type { Uppy } from '.'
import type { State, Uppy } from './Uppy'

export type PluginOpts = {
locale?: Locale
Expand Down Expand Up @@ -103,7 +103,7 @@ export default class BasePlugin<
uninstall(): void {}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
update(state: any): void {}
update(state: Partial<State<M, B>>): void {}

// Called after every state update, after everything's mounted. Debounced.
afterUpdate(): void {}
Expand Down
5 changes: 3 additions & 2 deletions packages/@uppy/core/src/UIPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import getTextDirection from '@uppy/utils/lib/getTextDirection'
import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
import BasePlugin from './BasePlugin.ts'
import type { PluginOpts } from './BasePlugin.ts'
import type { State } from './Uppy.ts'

/**
* Defer a frequent call to the microtask queue.
Expand Down Expand Up @@ -48,7 +49,7 @@ class UIPlugin<
M extends Meta,
B extends Body,
> extends BasePlugin<Opts, M, B> {
#updateUI: (state: any) => void
#updateUI: (state: Partial<State<M, B>>) => void

isTargetDOMEl: boolean

Expand Down Expand Up @@ -175,7 +176,7 @@ class UIPlugin<
)
}

update(state: any): void {
update(state: Partial<State<M, B>>): void {
if (this.el != null) {
this.#updateUI?.(state)
}
Expand Down
Loading