From 5e99ed7bbef0c03e3b9c2487c5bbe2675abab713 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 11 Aug 2019 19:38:08 +0800 Subject: [PATCH] :white_check_mark: Fix eslint warnings --- components/_util/throttleByAnimationFrame.tsx | 1 + components/carousel/index.tsx | 1 + components/form/Form.tsx | 2 +- components/modal/ActionButton.tsx | 1 + components/modal/index.tsx | 10 +++++----- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/components/_util/throttleByAnimationFrame.tsx b/components/_util/throttleByAnimationFrame.tsx index 155366c6dc..78e9ee0367 100644 --- a/components/_util/throttleByAnimationFrame.tsx +++ b/components/_util/throttleByAnimationFrame.tsx @@ -20,6 +20,7 @@ export default function throttleByAnimationFrame(fn: (...args: any[]) => void) { } export function throttleByAnimationFrameDecorator() { + // eslint-disable-next-line func-names return function(target: any, key: string, descriptor: any) { const fn = descriptor.value; let definingProperty = false; diff --git a/components/carousel/index.tsx b/components/carousel/index.tsx index 3a978b0512..37fd345367 100644 --- a/components/carousel/index.tsx +++ b/components/carousel/index.tsx @@ -23,6 +23,7 @@ if (typeof window !== 'undefined') { // Fix https://github.com/ant-design/ant-design/issues/6560 // Fix https://github.com/ant-design/ant-design/issues/3308 const SlickCarousel = polyfill(require('react-slick').default); + export type CarouselEffect = 'scrollx' | 'fade'; export type DotPosition = 'top' | 'bottom' | 'left' | 'right'; diff --git a/components/form/Form.tsx b/components/form/Form.tsx index 03708295f1..1b5c9645f9 100755 --- a/components/form/Form.tsx +++ b/components/form/Form.tsx @@ -221,7 +221,7 @@ export default class Form extends React.Component { static createFormField = createFormField; - static create = function( + static create = function create( options: FormCreateOption = {}, ): FormWrappedProps { return createDOMForm({ diff --git a/components/modal/ActionButton.tsx b/components/modal/ActionButton.tsx index a4213884a0..9e4afc0ddb 100644 --- a/components/modal/ActionButton.tsx +++ b/components/modal/ActionButton.tsx @@ -58,6 +58,7 @@ export default class ActionButton extends React.Component { // Emit error when catch promise reject + // eslint-disable-next-line no-console console.error(e); // See: https://github.com/ant-design/ant-design/issues/6183 this.setState({ loading: false }); diff --git a/components/modal/index.tsx b/components/modal/index.tsx index 28c4ea0e48..97c75789a2 100644 --- a/components/modal/index.tsx +++ b/components/modal/index.tsx @@ -16,7 +16,7 @@ function modalWarn(props: ModalFuncProps) { return confirm(config); } -Modal.info = function(props: ModalFuncProps) { +Modal.info = function infoFn(props: ModalFuncProps) { const config = { type: 'info', icon: , @@ -26,7 +26,7 @@ Modal.info = function(props: ModalFuncProps) { return confirm(config); }; -Modal.success = function(props: ModalFuncProps) { +Modal.success = function successFn(props: ModalFuncProps) { const config = { type: 'success', icon: , @@ -36,7 +36,7 @@ Modal.success = function(props: ModalFuncProps) { return confirm(config); }; -Modal.error = function(props: ModalFuncProps) { +Modal.error = function errorFn(props: ModalFuncProps) { const config = { type: 'error', icon: , @@ -50,7 +50,7 @@ Modal.warning = modalWarn; Modal.warn = modalWarn; -Modal.confirm = function(props: ModalFuncProps) { +Modal.confirm = function confirmFn(props: ModalFuncProps) { const config = { type: 'confirm', okCancel: true, @@ -59,7 +59,7 @@ Modal.confirm = function(props: ModalFuncProps) { return confirm(config); }; -Modal.destroyAll = function() { +Modal.destroyAll = function destroyAllFn() { while (destroyFns.length) { const close = destroyFns.pop(); if (close) {