mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-26 23:50:52 +01:00
Eslint updates
This commit is contained in:
parent
855d9f2f0d
commit
3c0e3693e1
@ -2,7 +2,7 @@
|
||||
"settings": {
|
||||
"react": {
|
||||
"pragma": "React",
|
||||
"version": "17.0.2"
|
||||
"version": "18.0.0"
|
||||
}
|
||||
},
|
||||
"env": {
|
||||
@ -11,7 +11,8 @@
|
||||
},
|
||||
"extends": [
|
||||
"plugin:react/recommended",
|
||||
"plugin:react/jsx-runtime"
|
||||
"plugin:react/jsx-runtime",
|
||||
"plugin:react-hooks/recommended"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
@ -26,9 +27,29 @@
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"rules": {
|
||||
"indent": ["error", 4, {"SwitchCase": 1}],
|
||||
"array-bracket-spacing": ["error", "always"],
|
||||
"brace-style": ["error", "allman"],
|
||||
"react/prop-types": ["off"]
|
||||
"linebreak-style": [ "off" ],
|
||||
"quotes": [ "error", "single" ],
|
||||
"@typescript-eslint/indent": [ "error", 4, { "SwitchCase": 1 } ],
|
||||
"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);
|
||||
}
|
||||
}, [ handleSelector, windowPosition, uniqueKey, disableDrag, bringToTop ]);
|
||||
}, [ handleSelector, windowPosition, uniqueKey, disableDrag, offsetLeft, offsetTop, bringToTop ]);
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
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 { Button, Column, Text } from '../../../../../../common';
|
||||
import { UseMessageEventHook, UseMountEffect } from '../../../../../../hooks';
|
||||
import { UseMessageEventHook } from '../../../../../../hooks';
|
||||
import { CatalogLayoutProps } from '../CatalogLayout.types';
|
||||
import { CatalogLayoutMarketplaceItemView, OWN_OFFER } from './CatalogLayoutMarketplaceItemView';
|
||||
import { MarketplaceOfferData } from './common/MarketplaceOfferData';
|
||||
@ -74,10 +74,10 @@ export const CatalogLayoutMarketplaceOwnItemsView: FC<CatalogLayoutProps> = prop
|
||||
SendMessageComposer(new CancelMarketplaceOfferMessageComposer(offerData.offerId));
|
||||
};
|
||||
|
||||
UseMountEffect(() =>
|
||||
useEffect(() =>
|
||||
{
|
||||
SendMessageComposer(new GetMarketplaceOwnOffersMessageComposer());
|
||||
});
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Column overflow="hidden">
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { EffectCallback, useEffect } from 'react';
|
||||
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
const useEffectOnce = (effect: EffectCallback) => useEffect(effect, []);
|
||||
|
||||
export const UseMountEffect = (fn: Function) => useEffectOnce(() => fn());
|
||||
|
Loading…
Reference in New Issue
Block a user