Skip to content

Commit

Permalink
feat: modify tsconfig noImplicitAny: false => true
Browse files Browse the repository at this point in the history
  • Loading branch information
imagine10255 committed Sep 21, 2023
1 parent 2c840fc commit 0ff8855
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/BearCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface IState {


class BearCarousel extends React.Component<IBearCarouselProps, IState> {
static defaultProps = {
static defaultProps: IBearCarouselProps = {
data: undefined,
slidesPerView: 1,
slidesPerGroup: 1, // 不可為小數
Expand All @@ -50,7 +50,6 @@ class BearCarousel extends React.Component<IBearCarouselProps, IState> {
moveTime: 500,
autoPlayTime: 5000,
initStartPlayTime: 1500,
defaultActivePage: 1,
isSlideItemMemo: false,
};
_isEnableGpuRender = checkIsDesktop();
Expand Down
1 change: 0 additions & 1 deletion src/manager/Configurator/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {IBreakpointSetting, TSlidesPerViewActual} from '../../types';
export interface ISetting extends IBreakpointSetting {
slidesPerViewActual?: TSlidesPerViewActual
moveTime?: number,
defaultActivePage?: number,
autoPlayTime?: number,
initStartPlayTime?: number,
isDebug?: boolean,
Expand Down
4 changes: 3 additions & 1 deletion src/manager/Elementor/Elementor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {getMoveDistance, getMovePercentage, getStartPosition} from './utils';
import Configurator from '../Configurator';
import Stater from '../Stater';
import {IPercentageInfo} from '../../types';
import {getObjectKeys} from '../../utils';

class Elementor {
_rootRef: RefObject<HTMLDivElement> = createRef();
Expand Down Expand Up @@ -206,7 +207,8 @@ class Elementor {
if(this._configurator.setting.moveEffect?.moveFn){
const moveStyles = this._configurator.setting.moveEffect.moveFn(percentageInfo);
if(moveStyles){
Object.keys(moveStyles).forEach(rowStyleKey => {
getObjectKeys(moveStyles).forEach(rowStyleKey => {
// @ts-ignore
el.style[rowStyleKey] = moveStyles[rowStyleKey];
});
if(isUseAnimation){
Expand Down
1 change: 0 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,3 @@ export type TToNext = () => void




12 changes: 7 additions & 5 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,17 @@ export function getLoopResetIndex(activeActualIndex: number, residue: number): n



type ObjectKeys<T> = Array<keyof T>;



export function getObjectKeys<T>(props: T): ObjectKeys<T> {
return Object.keys(props) as ObjectKeys<T>;
}

export function isPropsDiff(props: IBearCarouselProps, nextProps: IBearCarouselProps, exclude: string[]) {
const filterProps = Object.keys(props)
.filter(key => typeof props[key] !== 'function' && !exclude.includes(key))
const filterProps = getObjectKeys(props)
.filter((key) => typeof props[key] !== 'function' && !exclude.includes(key))
.map(key => props[key]);
const nextFilterProps = Object.keys(nextProps)
const nextFilterProps = getObjectKeys(nextProps)
.filter(key => typeof nextProps[key] !== 'function' && !exclude.includes(key))
.map(key => nextProps[key]);

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dom.iterable",
"esnext"
],
"noImplicitAny": false,
"noImplicitAny": true,
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
Expand Down

0 comments on commit 0ff8855

Please sign in to comment.