Skip to content

Commit

Permalink
chore: fix all linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
shafin-deriv committed Jun 4, 2024
1 parent 7910f7a commit 7d653ba
Show file tree
Hide file tree
Showing 276 changed files with 584 additions and 6,959 deletions.
5 changes: 5 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module.exports = {
rules: {
'global-require': 'off',
'import/no-extraneous-dependencies': 'off',
'class-methods-use-this': 'off',
},
overrides: [
{
Expand Down Expand Up @@ -30,6 +31,10 @@ module.exports = {
'plugin:prettier/recommended',
'plugin:react/jsx-runtime',
],
rules: {
// TODO: fix need to turn on later
'@typescript-eslint/no-explicit-any': 'off',
},
parserOptions: {
ecmaversion: 2018,
sourceType: 'module',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"build": "vite build",
"preview": "vite preview",
"test:lint": "prettier --log-level silent --write . && eslint \"./src/**/*.?(js|jsx|ts|tsx)\"",
"test:fix": "prettier --log-level silent --write . && eslint --fix --quiet \"./src/**/*.?(js|jsx|ts|tsx)\"",
"test": "vitest run",
"coverage": "vitest run --coverage",
"prepare": "husky install"
Expand Down
16 changes: 9 additions & 7 deletions src/components/audio/audio.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React from 'react';

const Audio = () => (
<>
<audio id='announcement' aria-label='audio' src={`${__webpack_public_path__}media/announcement.mp3`} />
<audio id='earned-money' aria-label='audio' src={`${__webpack_public_path__}media/coins.mp3`} />
<audio id='job-done' aria-label='audio' src={`${__webpack_public_path__}media/job-done.mp3`} />
<audio id='error' aria-label='audio' src={`${__webpack_public_path__}media/out-of-bounds.mp3`} />
<audio id='severe-error' aria-label='audio' src={`${__webpack_public_path__}media/i-am-being-serious.mp3`} />
<audio id='announcement' aria-label='audio' src={`${window.__webpack_public_path__}media/announcement.mp3`} />

Check warning on line 3 in src/components/audio/audio.tsx

View workflow job for this annotation

GitHub Actions / build_to_cloudflare_pages

Unexpected dangling '_' in '__webpack_public_path__'
<audio id='earned-money' aria-label='audio' src={`${window.__webpack_public_path__}media/coins.mp3`} />

Check warning on line 4 in src/components/audio/audio.tsx

View workflow job for this annotation

GitHub Actions / build_to_cloudflare_pages

Unexpected dangling '_' in '__webpack_public_path__'
<audio id='job-done' aria-label='audio' src={`${window.__webpack_public_path__}media/job-done.mp3`} />

Check warning on line 5 in src/components/audio/audio.tsx

View workflow job for this annotation

GitHub Actions / build_to_cloudflare_pages

Unexpected dangling '_' in '__webpack_public_path__'
<audio id='error' aria-label='audio' src={`${window.__webpack_public_path__}media/out-of-bounds.mp3`} />

Check warning on line 6 in src/components/audio/audio.tsx

View workflow job for this annotation

GitHub Actions / build_to_cloudflare_pages

Unexpected dangling '_' in '__webpack_public_path__'
<audio
id='severe-error'
aria-label='audio'
src={`${window.__webpack_public_path__}media/i-am-being-serious.mp3`}

Check warning on line 10 in src/components/audio/audio.tsx

View workflow job for this annotation

GitHub Actions / build_to_cloudflare_pages

Unexpected dangling '_' in '__webpack_public_path__'
/>
</>
);

Expand Down
1 change: 1 addition & 0 deletions src/components/blockly-loading/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import BlocklyLoading from './blockly-loading';

import './blockly-loading.scss';

export default BlocklyLoading;
1 change: 1 addition & 0 deletions src/components/bot-notification-messages/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import BotNotificationMessages from './bot-notification-messages';

import './bot-notification-messages.scss';

export default BotNotificationMessages;
1 change: 1 addition & 0 deletions src/components/bot-notification/bot-notification.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { toast } from 'react-toastify';

import { notification_style, TAction, TNotificationContent, TNotificationStyle } from './bot-notification-utils';

export const NotificationContent: React.FC<TNotificationContent> = ({ message, primary_action, closeToast }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import ContentLoader from 'react-content-loader';

type TContractCardLoader = {
Expand Down
1 change: 1 addition & 0 deletions src/components/contract-result-overlay/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ContractResultOverlay from './contract-result-overlay';

import './contract-result-overlay.scss';

export default ContractResultOverlay;
1 change: 1 addition & 0 deletions src/components/download/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Download from './download';

import './download.scss';

export default Download;
1 change: 1 addition & 0 deletions src/components/draggable/draggable-resize-wrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState } from 'react';
import debounce from 'lodash.debounce';

import Draggable from './draggable';

type DraggableResizeWrapperProps = {
Expand Down
1 change: 1 addition & 0 deletions src/components/draggable/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Draggable from './draggable';

import './draggable.scss';

export default Draggable;
2 changes: 0 additions & 2 deletions src/components/flyout/help-contents/flyout-img.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

type TFlyoutImageProps = {
width: string;
url: string;
Expand Down
1 change: 0 additions & 1 deletion src/components/flyout/help-contents/flyout-text.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { Text } from '@deriv-com/ui';

const FlyoutText = (props: { text: string }) => {
Expand Down
2 changes: 0 additions & 2 deletions src/components/flyout/help-contents/flyout-video.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import React from 'react';

const FlyoutVideo = (props: { url: string }) => (
<div className='flyout__item' data-testid='dt_flyout_video_container'>
<iframe
Expand Down
1 change: 1 addition & 0 deletions src/components/flyout/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Flyout from './flyout';

import './flyout.scss';

export default Flyout;
1 change: 1 addition & 0 deletions src/components/journal/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Journal from './journal';

import './journal.scss';

export default Journal;
1 change: 0 additions & 1 deletion src/components/journal/journal-components/date-item.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { TDateItemProps } from '../journal.types';

const DateItem = ({ date, time }: TDateItemProps) => (
Expand Down
2 changes: 1 addition & 1 deletion src/components/journal/journal-components/filters.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Checkbox } from '@deriv-com/ui';

import { TFiltersProps } from '../journal.types';

const Filters = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import classnames from 'classnames';

import { Text } from '@deriv-com/ui';

import { formatMoney, getCurrencyDisplayCode } from '@/components/shared';
import { LogTypes } from '@/external/bot-skeleton';
import { formatMoney, getCurrencyDisplayCode } from '@/utils/tmp/currency-helper';
import { Localize, localize } from '@/utils/tmp/dummy';

import { TFormatMessageProps } from '../journal.types';
Expand Down
3 changes: 1 addition & 2 deletions src/components/journal/journal-components/journal-loader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import classnames from 'classnames';
import ContentLoader from 'react-content-loader';
import classnames from 'classnames';

const JournalLoader = ({ is_mobile }: { is_mobile: boolean }) => (
<ContentLoader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CSSTransition } from 'react-transition-group';
import { Text } from '@deriv-com/ui';

import Download from '@/components/download';
import { Icon, localize } from '@/utils/tmp/dummy';
import { Icon, Localize } from '@/utils/tmp/dummy';

import { TJournalToolsProps } from '../journal.types';

Expand Down
1 change: 1 addition & 0 deletions src/components/load-modal/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import LoadModal from './load-modal';

import './load-modal.scss';

export default LoadModal;
2 changes: 1 addition & 1 deletion src/components/load-modal/recent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import classnames from 'classnames';
import { observer } from 'mobx-react-lite';

import { useStore } from '@/hooks/useStore';
import { Icon, localize } from '@/utils/tmp/dummy';
import { Icon, Localize } from '@/utils/tmp/dummy';

import RecentWorkspace from './recent-workspace';
import WorkspaceControl from './workspace-control';
Expand Down
12 changes: 6 additions & 6 deletions src/components/network-toast-popup/network-toast-popup.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React from 'react';
import ReactDOM from 'react-dom';
import classNames from 'classnames';
// import classNames from 'classnames';
import { observer } from 'mobx-react-lite';

import { Toast } from '@deriv-com/ui';

import { useStore } from '@/hooks/useStore';
// import { Toast } from '@deriv-com/ui';
// import { useStore } from '@/hooks/useStore';

// TODO: Need to sanitize,
// Same sort of component is being used inside DTrader,
Expand All @@ -16,13 +15,14 @@ import { useStore } from '@/hooks/useStore';
*/

const NetworkStatusToastError = observer(({ should_open = false }: { should_open?: boolean }) => {
const { common } = useStore();
// const { common } = useStore();
// const { network_status } = common;
const [is_open, setIsOpen] = React.useState(should_open);
// const { message, status } = network_status;
const portal_el = document.getElementById('popup_root');

if (!portal_el || !message) return null;
// if (!portal_el || !message) return null;
if (!portal_el) return null;

if (!is_open && status !== 'online') {
setIsOpen(true); // open if status === 'blinker' or 'offline'
Expand Down
1 change: 1 addition & 0 deletions src/components/notify-item/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { arrayAsMessage, messageWithButton, messageWithImage } from './notify-item';

import './notify-item.scss';

export { arrayAsMessage, messageWithButton, messageWithImage };
1 change: 1 addition & 0 deletions src/components/run-panel/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import RunPanel from './run-panel';

import './run-panel.scss';

export default RunPanel;
Loading

0 comments on commit 7d653ba

Please sign in to comment.