[improvement] lint ts/tsx files (#2776)

This commit is contained in:
neverland
2019-02-18 14:45:31 +08:00
committed by GitHub
parent 29fad2235a
commit 0013185d38
9 changed files with 57 additions and 19 deletions
+2 -3
View File
@@ -1,15 +1,14 @@
import { use } from '../utils';
import { emit, inherit } from '../utils/functional';
import { routeProps, functionalRoute } from '../mixins/router';
import { routeProps, RouteProps, functionalRoute } from '../mixins/router';
import Loading from '../loading';
// Types
import { RouteProps } from '../mixins/router';
import { FunctionalComponent } from '../utils/use/sfc';
const [sfc, bem] = use('button');
const Button: FunctionalComponent<ButtonProps> = function(
const Button: FunctionalComponent<ButtonProps> = function (
h,
props,
slots,
+3 -4
View File
@@ -1,17 +1,16 @@
import { use, isDef } from '../utils';
import { cellProps } from './shared';
import { cellProps, SharedCellProps } from './shared';
import { emit, inherit } from '../utils/functional';
import { routeProps, functionalRoute } from '../mixins/router';
import Icon from '../icon';
// Types
import { SharedCellProps } from './shared';
import { FunctionalComponent } from '../utils/use/sfc';
import { Mods } from '../utils/use/bem';
const [sfc, bem] = use('cell');
const Cell: FunctionalComponent<CellProps> = function(h, props, slots, ctx) {
const Cell: FunctionalComponent<CellProps> = function (h, props, slots, ctx) {
const { icon, size, title, label, value, isLink, arrowDirection } = props;
const showTitle = slots.title || isDef(title);
@@ -78,7 +77,7 @@ const Cell: FunctionalComponent<CellProps> = function(h, props, slots, ctx) {
{slots.extra && slots.extra()}
</div>
);
}
};
export type CellProps = SharedCellProps & {
size?: string;
+1 -1
View File
@@ -8,7 +8,7 @@ import { FunctionalComponent } from '../utils/use/sfc';
const [sfc] = use('icon');
const Icon: FunctionalComponent<IconProps> = function(h, props, slots, ctx) {
const Icon: FunctionalComponent<IconProps> = function (h, props, slots, ctx) {
const urlIcon = isSrc(props.name);
return (
+1 -1
View File
@@ -6,7 +6,7 @@ import { FunctionalComponent } from '../utils/use/sfc';
const [sfc, bem] = use('info');
const Info: FunctionalComponent<InfoProps> = function(h, props, slots, ctx) {
const Info: FunctionalComponent<InfoProps> = function (h, props, slots, ctx) {
if (!isDef(props.info)) {
return;
}
+1 -1
View File
@@ -7,7 +7,7 @@ import { FunctionalComponent } from '../utils/use/sfc';
const [sfc, bem] = use('loading');
const DEFAULT_COLOR = '#c9c9c9';
const Loading: FunctionalComponent<LoadingProps> = function(
const Loading: FunctionalComponent<LoadingProps> = function (
h,
props,
slots,
+1 -1
View File
@@ -13,7 +13,7 @@ const COLOR_MAP: { [key: string]: string } = {
success: GREEN
};
const Tag: FunctionalComponent<TagProps> = function(h, props, slots, ctx) {
const Tag: FunctionalComponent<TagProps> = function (h, props, slots, ctx) {
const { type, mark, plain, round, size } = ctx.props;
const color = props.color || (type && COLOR_MAP[type]) || GRAY_DARK;
+1 -1
View File
@@ -28,7 +28,7 @@ export type ModelOptions = {
export interface VantComponentOptions extends ComponentOptions<Vue> {
functional?: boolean;
install?: (Vue: VueConstructor) => void;
};
}
export type DefaultProps = Record<string, any>;