Skip to content

Commit a34e6eb

Browse files
committed
fix: fix or ignore typescript error
1 parent dc1a9fc commit a34e6eb

File tree

17 files changed

+33
-20
lines changed

17 files changed

+33
-20
lines changed

src/common/utils.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ function delay(delayTime = 25): Promise<null> {
1212
}
1313

1414
function delayQuerySelector(
15-
self,
1615
selectorStr: string,
1716
delayTime = 500
1817
): Promise<any[]> {
@@ -42,11 +41,7 @@ function delayGetScrollOffset({ delayTime = 500 }): Promise<any[]> {
4241
})
4342
}
4443

45-
function delayGetClientRect({
46-
self,
47-
selectorStr,
48-
delayTime = 500
49-
}): Promise<any[]> {
44+
function delayGetClientRect({ selectorStr, delayTime = 500 }): Promise<any[]> {
5045
const selector: SelectorQuery = Taro.createSelectorQuery()
5146

5247
return new Promise(resolve => {

src/components/accordion/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default class AtAccordion extends React.Component<
3737
if (!this.isCompleted || !isAnimation) return
3838

3939
this.isCompleted = false
40-
delayQuerySelector(this, '.at-accordion__body', 0).then(rect => {
40+
delayQuerySelector('.at-accordion__body', 0).then(rect => {
4141
const height = parseInt(rect[0].height.toString())
4242
const startHeight = open ? height : 0
4343
const endHeight = open ? 0 : height

src/components/button/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export default class AtButton extends React.Component<
6363
private onSumit(event: CommonEvent): void {
6464
if (this.state.isWEAPP || this.state.isWEB) {
6565
// TODO: 3.0 this.$scope
66+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
67+
// @ts-ignore
6668
this.$scope.triggerEvent('submit', event.detail, {
6769
bubbles: true,
6870
composed: true
@@ -73,6 +75,8 @@ export default class AtButton extends React.Component<
7375
private onReset(event: CommonEvent): void {
7476
if (this.state.isWEAPP || this.state.isWEB) {
7577
// TODO: 3.0 this.$scope
78+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
79+
// @ts-ignore
7680
this.$scope.triggerEvent('reset', event.detail, {
7781
bubbles: true,
7882
composed: true

src/components/calendar/body/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default class AtCalendarBody extends React.Component<
6767
}
6868

6969
public componentDidMount(): void {
70-
delayQuerySelector(this, '.at-calendar-slider__main').then(res => {
70+
delayQuerySelector('.at-calendar-slider__main').then(res => {
7171
this.maxWidth = res[0].width
7272
})
7373
}

src/components/grid/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import _isFunction from 'lodash/isFunction'
44
import _isObject from 'lodash/isObject'
55
import PropTypes, { InferProps } from 'prop-types'
66
import React from 'react'
7-
import { AtGridProps, Item } from 'types/grid'
7+
import { AtGridProps, AtGridItem } from 'types/grid'
88
import { Image, Text, View } from '@tarojs/components'
99
import { CommonEvent } from '@tarojs/components/types/common'
1010
import { mergeStyle } from '../../common/utils'
@@ -14,7 +14,7 @@ export default class AtGrid extends React.Component<AtGridProps> {
1414
public static propTypes: InferProps<AtGridProps>
1515

1616
private handleClick = (
17-
item: Item,
17+
item: AtGridItem,
1818
index: number,
1919
row: number,
2020
event: CommonEvent

src/components/indexes/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default class AtIndexes extends React.Component<
8282
const _tipText = idx === 0 ? topKey : list[idx - 1].key
8383

8484
if (ENV === Taro.ENV_TYPE.WEB) {
85-
delayQuerySelector(this, '.at-indexes', 0).then(rect => {
85+
delayQuerySelector('.at-indexes', 0).then(rect => {
8686
const targetOffsetTop = this.listRef.childNodes[idx].offsetTop
8787
const _scrollTop = targetOffsetTop - rect[0].top
8888
this.updateState({
@@ -137,7 +137,7 @@ export default class AtIndexes extends React.Component<
137137
}
138138

139139
private initData(): void {
140-
delayQuerySelector(this, '.at-indexes__menu').then(rect => {
140+
delayQuerySelector('.at-indexes__menu').then(rect => {
141141
const len = this.props.list.length
142142
this.menuHeight = rect[0].height
143143
this.startTop = rect[0].top

src/components/input/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ export default class AtInput extends React.Component<AtInputProps> {
104104
focus,
105105
value,
106106
required,
107+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
108+
// @ts-ignore
107109
onKeyboardHeightChange
108110
} = this.props
109111
const { type, maxLength, disabled, password } = getInputProps(this.props)
@@ -162,6 +164,8 @@ export default class AtInput extends React.Component<AtInputProps> {
162164
onFocus={this.onFocus}
163165
onBlur={this.onBlur}
164166
onConfirm={this.onConfirm}
167+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
168+
// @ts-ignore
165169
onKeyboardHeightChange={onKeyboardHeightChange}
166170
/>
167171
{clear && value && (

src/components/modal/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ export default class AtModal extends React.Component<
105105
<View className='content-simple'>
106106
{isWEB ? (
107107
<Text
108+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
109+
// @ts-ignore
108110
dangerouslySetInnerHTML={{
109111
__html: content.replace(/\n/g, '<br/>')
110112
}}

src/components/noticebar/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ export default class AtNoticebar extends React.Component<
171171
<View
172172
id={this.state.animElemId}
173173
animation={{
174+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
175+
// @ts-ignore
174176
actions: this.state.animationData
175177
}}
176178
className={classNames(innerClassName)}

src/components/pagination/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const getMaxPage = (maxPage = 0): number => {
1212
}
1313

1414
const createPickerRange = (max: number): number[] => {
15-
const range = new Array(max).fill(0).map((val, index) => index + 1)
15+
const range = new Array(max).fill(0).map((_val, index) => index + 1)
1616
return range
1717
}
1818

0 commit comments

Comments
 (0)