mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-23 06:40:50 +01:00
Eslint updates
This commit is contained in:
parent
855d9f2f0d
commit
3c0e3693e1
@ -2,7 +2,7 @@
|
|||||||
"settings": {
|
"settings": {
|
||||||
"react": {
|
"react": {
|
||||||
"pragma": "React",
|
"pragma": "React",
|
||||||
"version": "17.0.2"
|
"version": "18.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"env": {
|
"env": {
|
||||||
@ -11,7 +11,8 @@
|
|||||||
},
|
},
|
||||||
"extends": [
|
"extends": [
|
||||||
"plugin:react/recommended",
|
"plugin:react/recommended",
|
||||||
"plugin:react/jsx-runtime"
|
"plugin:react/jsx-runtime",
|
||||||
|
"plugin:react-hooks/recommended"
|
||||||
],
|
],
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
@ -26,9 +27,29 @@
|
|||||||
"@typescript-eslint"
|
"@typescript-eslint"
|
||||||
],
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"indent": ["error", 4, {"SwitchCase": 1}],
|
"linebreak-style": [ "off" ],
|
||||||
"array-bracket-spacing": ["error", "always"],
|
"quotes": [ "error", "single" ],
|
||||||
"brace-style": ["error", "allman"],
|
"@typescript-eslint/indent": [ "error", 4, { "SwitchCase": 1 } ],
|
||||||
"react/prop-types": ["off"]
|
"array-bracket-spacing": [ "error", "always" ],
|
||||||
|
"brace-style": [ "error", "allman" ],
|
||||||
|
"react/prop-types": [ "off" ],
|
||||||
|
"object-curly-spacing": [ "error", "always" ],
|
||||||
|
"@typescript-eslint/ban-types": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"types": {
|
||||||
|
"String": true,
|
||||||
|
"Boolean": true,
|
||||||
|
"Number": true,
|
||||||
|
"Symbol": true,
|
||||||
|
"{}": false,
|
||||||
|
"Object": false,
|
||||||
|
"object": false,
|
||||||
|
"Function": false
|
||||||
|
},
|
||||||
|
"extendDefaults": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"no-switch-case-fall-through": [ "off" ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ export const DraggableWindow: FC<DraggableWindowProps> = props =>
|
|||||||
|
|
||||||
if(index >= 0) CURRENT_WINDOWS.splice(index, 1);
|
if(index >= 0) CURRENT_WINDOWS.splice(index, 1);
|
||||||
}
|
}
|
||||||
}, [ handleSelector, windowPosition, uniqueKey, disableDrag, bringToTop ]);
|
}, [ handleSelector, windowPosition, uniqueKey, disableDrag, offsetLeft, offsetTop, bringToTop ]);
|
||||||
|
|
||||||
useEffect(() =>
|
useEffect(() =>
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { CancelMarketplaceOfferMessageComposer, GetMarketplaceOwnOffersMessageComposer, MarketplaceCancelOfferResultEvent, MarketplaceOwnOffersEvent, RedeemMarketplaceOfferCreditsMessageComposer } from '@nitrots/nitro-renderer';
|
import { CancelMarketplaceOfferMessageComposer, GetMarketplaceOwnOffersMessageComposer, MarketplaceCancelOfferResultEvent, MarketplaceOwnOffersEvent, RedeemMarketplaceOfferCreditsMessageComposer } from '@nitrots/nitro-renderer';
|
||||||
import { FC, useCallback, useMemo, useState } from 'react';
|
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
import { LocalizeText, NotificationAlertType, NotificationUtilities, SendMessageComposer } from '../../../../../../api';
|
import { LocalizeText, NotificationAlertType, NotificationUtilities, SendMessageComposer } from '../../../../../../api';
|
||||||
import { Button, Column, Text } from '../../../../../../common';
|
import { Button, Column, Text } from '../../../../../../common';
|
||||||
import { UseMessageEventHook, UseMountEffect } from '../../../../../../hooks';
|
import { UseMessageEventHook } from '../../../../../../hooks';
|
||||||
import { CatalogLayoutProps } from '../CatalogLayout.types';
|
import { CatalogLayoutProps } from '../CatalogLayout.types';
|
||||||
import { CatalogLayoutMarketplaceItemView, OWN_OFFER } from './CatalogLayoutMarketplaceItemView';
|
import { CatalogLayoutMarketplaceItemView, OWN_OFFER } from './CatalogLayoutMarketplaceItemView';
|
||||||
import { MarketplaceOfferData } from './common/MarketplaceOfferData';
|
import { MarketplaceOfferData } from './common/MarketplaceOfferData';
|
||||||
@ -74,10 +74,10 @@ export const CatalogLayoutMarketplaceOwnItemsView: FC<CatalogLayoutProps> = prop
|
|||||||
SendMessageComposer(new CancelMarketplaceOfferMessageComposer(offerData.offerId));
|
SendMessageComposer(new CancelMarketplaceOfferMessageComposer(offerData.offerId));
|
||||||
};
|
};
|
||||||
|
|
||||||
UseMountEffect(() =>
|
useEffect(() =>
|
||||||
{
|
{
|
||||||
SendMessageComposer(new GetMarketplaceOwnOffersMessageComposer());
|
SendMessageComposer(new GetMarketplaceOwnOffersMessageComposer());
|
||||||
});
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column overflow="hidden">
|
<Column overflow="hidden">
|
||||||
|
@ -6,9 +6,9 @@ import { WidgetContainerView } from './widget-container/WidgetContainerView';
|
|||||||
|
|
||||||
export interface GetWidgetLayoutProps
|
export interface GetWidgetLayoutProps
|
||||||
{
|
{
|
||||||
widgetType: string;
|
widgetType: string;
|
||||||
slot: number;
|
slot: number;
|
||||||
widgetConf: any;
|
widgetConf: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const GetWidgetLayout: FC<GetWidgetLayoutProps> = props =>
|
export const GetWidgetLayout: FC<GetWidgetLayoutProps> = props =>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { EffectCallback, useEffect } from 'react';
|
import { EffectCallback, useEffect } from 'react';
|
||||||
|
|
||||||
|
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
const useEffectOnce = (effect: EffectCallback) => useEffect(effect, []);
|
const useEffectOnce = (effect: EffectCallback) => useEffect(effect, []);
|
||||||
|
|
||||||
export const UseMountEffect = (fn: Function) => useEffectOnce(() => fn());
|
export const UseMountEffect = (fn: Function) => useEffectOnce(() => fn());
|
||||||
|
Loading…
Reference in New Issue
Block a user