"size-runtime": "node scripts/build.js runtime-dom -p -f global",
"size-compiler": "node scripts/build.js compiler-dom -p -f global",
"size": "yarn size-runtime && yarn size-compiler",
- "lint": "prettier --write --parser typescript \"packages/**/*.ts\"",
+ "lint": "prettier --write --parser typescript \"packages/**/*.ts?(x)\"",
"test": "jest"
},
"gitHooks": {
"prettier --write",
"git add"
],
- "*.ts": [
+ "*.ts?(x)": [
"prettier --parser=typescript --write",
"git add"
]
if (
// if event name is dynamic, always wrap with keys guard
key.type === NodeTypes.COMPOUND_EXPRESSION ||
- !(key.isStatic) ||
+ !key.isStatic ||
key.content.toLowerCase() in KEYBOARD_EVENTS
) {
handler = createCallExpression(context.helper(V_ON_KEYS_GUARD), [
}
})
// test TSX props inference
- ;(<MyComponent a={1} b="foo" dd={['foo']} ddd={['foo']}/>)
+ ;<MyComponent a={1} b="foo" dd={['foo']} ddd={['foo']} />
})
test('type inference w/ optional props declaration', () => {
return h('div', this.msg)
}
})
- ;(<Comp msg="hello"/>)
+ ;<Comp msg="hello" />
})
test('type inference w/ direct setup function', () => {
const Comp = createComponent((props: { msg: string }) => {
return () => <div>{props.msg}</div>
})
- ;(<Comp msg="hello"/>)
+ ;<Comp msg="hello" />
})
test('type inference w/ array props declaration', () => {
this.c
}
})
- ;(<Comp a={1} b={2}/>)
+ ;<Comp a={1} b={2} />
})
test('with legacy options', () => {
const createHook = <T extends Function = () => any>(
lifecycle: LifecycleHooks
-) => (
- hook: T,
- target: ComponentInternalInstance | null = currentInstance
-) => injectHook(lifecycle, hook, target)
+) => (hook: T, target: ComponentInternalInstance | null = currentInstance) =>
+ injectHook(lifecycle, hook, target)
export const onBeforeMount = createHook(LifecycleHooks.BEFORE_MOUNT)
export const onMounted = createHook(LifecycleHooks.MOUNTED)
}
} else if (isObject(source)) {
if (source[Symbol.iterator as any]) {
- ret = Array.from(
- source as Iterable<any>,
- renderItem
- )
+ ret = Array.from(source as Iterable<any>, renderItem)
} else {
const keys = Object.keys(source)
ret = new Array(keys.length)
}
}
-
// Kept for 2.x compat.
// Note: IE11 compat for `spacebar` and `del` is removed for now.
const keyNames: Record<string, string | string[]> = {