Skip to content

Commit

Permalink
Thisyahlen/updated eslint wallets (deriv-com#10388)
Browse files Browse the repository at this point in the history
* chore: fix ci

* chore: add new eslint rule for typescript and enabled switch account for mobile

* chore: update eslint
  • Loading branch information
thisyahlen-deriv authored Sep 29, 2023
1 parent 47a91f5 commit 5b461be
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions packages/wallets/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = {
env: { es6: true },
plugins: ['eslint-plugin-local-rules', 'simple-import-sort', 'sort-destructure-keys', 'typescript-sort-keys'],
rules: {
camelcase: 'error',
'simple-import-sort/imports': [
'error',
{
Expand Down Expand Up @@ -36,12 +37,15 @@ module.exports = {
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/sort-type-constituents': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
'import/no-extraneous-dependencies': ['off', { devDependencies: ['**/*.spec.*', '**/*.test.*', '**/*.d.ts*'] }],
'lines-around-comment': ['error', { allowObjectStart: true }],
'local-rules/no-react-namespace': 'error',
'no-unneeded-ternary': 'error',
'no-useless-return': 'error',
'object-shorthand': 'error',
'prefer-const': 'error',
'react/jsx-pascal-case': 'error',
Expand All @@ -51,8 +55,6 @@ module.exports = {
'sort-keys': 'warn',
'typescript-sort-keys/interface': 'warn',
'typescript-sort-keys/string-enum': 'warn',
camelcase: 'error',
'import/no-extraneous-dependencies': ['off', { devDependencies: ['**/*.spec.*', '**/*.test.*', '**/*.d.ts*'] }],
},
overrides: [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useState } from 'react';
import { MT5AccountType } from '../ExternalTradingPlatforms/MT5AccountType';
import { PrimaryActionButton } from '../PrimaryActionButton';
import { WalletModal } from '../WalletModal';
Expand All @@ -7,7 +7,7 @@ import { WideWrapper } from '../WideWrapper';
type TMarketTypes = React.ComponentProps<typeof MT5AccountType>['selectedMarketType'];

const MT5AccountTypeModal = () => {
const [selectedMarketType, setSelectedMarketType] = React.useState<TMarketTypes>(undefined);
const [selectedMarketType, setSelectedMarketType] = useState<TMarketTypes>(undefined);

return (
<WalletModal>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ const WalletsCarouselContent: React.FC = () => {

useEffect(() => {
walletsCarouselEmblaApi?.on('settle', () => {
// const scroll_snap_index = walletsCarouselEmblaApi?.selectedScrollSnap();
// const loginid = wallet_accounts_list[scroll_snap_index]?.loginid;
// switchAccount(loginid);
const scrollSnapIndex = walletsCarouselEmblaApi?.selectedScrollSnap();
const loginid = walletAccountsList?.[scrollSnapIndex]?.loginid;
switchAccount(loginid || '');
});

walletsCarouselEmblaApi?.on('select', () => {
Expand Down

0 comments on commit 5b461be

Please sign in to comment.