Skip to content

Commit

Permalink
chore(types): remove unnecessary type assertions (#4336)
Browse files Browse the repository at this point in the history
  • Loading branch information
webfansplz authored Aug 16, 2021
1 parent 7c4e451 commit 0627765
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function ssrTransformSuspense(
return () => {
if (node.children.length) {
const wipEntry: WIPEntry = {
slotsExp: null as any,
slotsExp: null!, // to be immediately set
wipSlots: []
}
wipMap.set(node, wipEntry)
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-core/src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ export function createComponentInstance(
emitsOptions: normalizeEmitsOptions(type, appContext),

// emit
emit: null as any, // to be set immediately
emit: null!, // to be set immediately
emitted: null,

// props default value
Expand Down
2 changes: 1 addition & 1 deletion packages/runtime-core/src/componentOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ export function applyOptions(instance: ComponentInternalInstance) {
`Plain object usage is no longer supported.`
)
}
const data = (dataOptions as any).call(publicThis, publicThis)
const data = dataOptions.call(publicThis, publicThis)
if (__DEV__ && isPromise(data)) {
warn(
`data() returned a Promise - note data() cannot be async; If you ` +
Expand Down
3 changes: 1 addition & 2 deletions packages/runtime-dom/src/directives/vOn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ export const withKeys = (fn: Function, modifiers: string[]) => {
compatUtils.isCompatEnabled(DeprecationTypes.CONFIG_KEY_CODES, instance)
) {
if (instance) {
globalKeyCodes = (instance.appContext.config as any as LegacyConfig)
.keyCodes
globalKeyCodes = (instance.appContext.config as LegacyConfig).keyCodes
}
}
if (__DEV__ && modifiers.some(m => /^\d+$/.test(m))) {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/__tests__/e2eUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function setupPuppeteer() {

page.on('console', e => {
if (e.type() === 'error') {
const err = e.args()[0] as any
const err = e.args()[0]
console.error(
`Error from Puppeteer-loaded page:\n`,
err._remoteObject.description
Expand Down

0 comments on commit 0627765

Please sign in to comment.