Skip to content

Commit 0627765

Browse files
authored
chore(types): remove unnecessary type assertions (#4336)
1 parent 7c4e451 commit 0627765

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

packages/compiler-ssr/src/transforms/ssrTransformSuspense.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function ssrTransformSuspense(
3232
return () => {
3333
if (node.children.length) {
3434
const wipEntry: WIPEntry = {
35-
slotsExp: null as any,
35+
slotsExp: null!, // to be immediately set
3636
wipSlots: []
3737
}
3838
wipMap.set(node, wipEntry)

packages/runtime-core/src/component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ export function createComponentInstance(
475475
emitsOptions: normalizeEmitsOptions(type, appContext),
476476

477477
// emit
478-
emit: null as any, // to be set immediately
478+
emit: null!, // to be set immediately
479479
emitted: null,
480480

481481
// props default value

packages/runtime-core/src/componentOptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ export function applyOptions(instance: ComponentInternalInstance) {
651651
`Plain object usage is no longer supported.`
652652
)
653653
}
654-
const data = (dataOptions as any).call(publicThis, publicThis)
654+
const data = dataOptions.call(publicThis, publicThis)
655655
if (__DEV__ && isPromise(data)) {
656656
warn(
657657
`data() returned a Promise - note data() cannot be async; If you ` +

packages/runtime-dom/src/directives/vOn.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ export const withKeys = (fn: Function, modifiers: string[]) => {
6666
compatUtils.isCompatEnabled(DeprecationTypes.CONFIG_KEY_CODES, instance)
6767
) {
6868
if (instance) {
69-
globalKeyCodes = (instance.appContext.config as any as LegacyConfig)
70-
.keyCodes
69+
globalKeyCodes = (instance.appContext.config as LegacyConfig).keyCodes
7170
}
7271
}
7372
if (__DEV__ && modifiers.some(m => /^\d+$/.test(m))) {

packages/vue/__tests__/e2eUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function setupPuppeteer() {
4141

4242
page.on('console', e => {
4343
if (e.type() === 'error') {
44-
const err = e.args()[0] as any
44+
const err = e.args()[0]
4545
console.error(
4646
`Error from Puppeteer-loaded page:\n`,
4747
err._remoteObject.description

0 commit comments

Comments
 (0)