Skip to content

Commit

Permalink
fix: fix ESLint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JalilArfaoui committed Sep 6, 2019
1 parent 0b7bbe0 commit 5d8788b
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 30 deletions.
6 changes: 4 additions & 2 deletions src/app/actions/webext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ import { From } from 'webext/From';

export interface ListeningActionsReadyAction extends BaseAction {
type: 'LISTENING_ACTIONS_READY';
meta: ActionMeta;
meta: ActionMeta & {
from: From;
};
}

export const listeningActionsReady = (
from: From,
meta: ActionMeta = {}
meta: ActionMeta
): ListeningActionsReadyAction => ({
type: 'LISTENING_ACTIONS_READY',
meta: { ...meta, from }
Expand Down
5 changes: 4 additions & 1 deletion src/app/background/sagas/tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ export const contextTriggeredSaga = function*({
}
};

/* eslint-disable no-unused-vars */
/* eslint-disable @typescript-eslint/no-unused-vars */
const waitForTabReadySaga = (tab: Tab) =>
function*() {
yield take((readyAction: AppAction) =>
Expand All @@ -136,7 +138,8 @@ export function* publishToTabSaga(action: TabAction) {
yield take((readyAction: AppAction) =>
Boolean(
readyAction.type === 'LISTENING_ACTIONS_READY' &&
readyAction.meta.tab!.id === tab.id
readyAction.meta.tab &&
readyAction.meta.tab.id === tab.id
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { storiesOf } from '@storybook/react';
import Subscriptions from './Subscriptions';
import SubscriptionsEmpty from './SubscriptionsEmpty';
import Suggestions from './Suggestions';
import Wrapper from './Wrapper';

storiesOf('screens/SubscriptionsScreen', module)
.add('subcriptions', () => <Subscriptions />)
Expand Down
5 changes: 3 additions & 2 deletions src/app/settings/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { configureSentryScope, initSentry } from '../utils/sentry';
import { configureSentryScope, initSentry, Scope } from '../utils/sentry';

initSentry();

configureSentryScope((scope: any) => {
configureSentryScope((scope: Scope) => {
scope.setTag('context', 'settings');
});

/* eslint-disable import/first */
import React from 'react';
import { render } from 'react-dom';
import App from './App';
Expand Down
1 change: 1 addition & 0 deletions src/app/settings/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const applyMiddlewares =
)
: applyMiddleware(...middlewares);

/* eslint-disable @typescript-eslint/no-explicit-any */
const addReduxDevTools = (window as any).__REDUX_DEVTOOLS_EXTENSION__
? (window as any).__REDUX_DEVTOOLS_EXTENSION__()
: (f: any): any => f;
Expand Down
4 changes: 2 additions & 2 deletions src/components/atoms/Stat/Stat.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import { withKnobs, text } from '@storybook/addon-knobs';
import { withKnobs } from '@storybook/addon-knobs';
import Stat from './Stat';
import StatType from './StatType';

Expand All @@ -13,7 +13,7 @@ storiesOf('atoms/Stat', module)
))
.add('J aime', () => (
<Stat>
430 <StatType>J'aime</StatType>
430 <StatType>J&apos;aime</StatType>
</Stat>
))
.add('Abonnés', () => (
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/Contributor/ContributorButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const ContributorButton = ({ followed }: Props) =>
</Container>
) : (
<Container>
<BorderButton>S'abonner</BorderButton>
<BorderButton>S&apos;abonner</BorderButton>
</Container>
);

Expand Down
11 changes: 0 additions & 11 deletions src/components/organisms/Contributor/ContributorCompact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,6 @@ const StatsWrapper = styled.div`
}
`;

const StatIcon = styled.div`
& > svg {
stroke: ${props => props.theme.secondaryColor};
fill: #fff;
transform: scale(-1, 1);
width: 10px;
height: auto;
margin-right: 3px;
}
`;

export const Contributor = () => (
<ContributorWrapper>
<Avatar />
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/Contributor/ContributorLarge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const ContributorLarge = ({ contributor }: Props) => (
{contributor.contributions} <StatType>Bulles</StatType>
</Stat>
<Stat>
120 <StatType>J'aime</StatType>
120 <StatType>J&apos;aime</StatType>
</Stat>
<Stat>
120 <StatType>Abonnés</StatType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface Props {
}
const ContributorButton = ({ followed }: Props) =>
followed ? (
<BackgroundButton>Abonné</BackgroundButton>
<BackgroundButton>Abonn&eacute;</BackgroundButton>
) : (
<BorderButton>Suivre</BorderButton>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import { MemoryRouter as Router } from 'react-router-dom';
import { storiesOf } from '@storybook/react';
import ContributorNav from './ContributorNav';

Expand Down
1 change: 0 additions & 1 deletion src/components/organisms/ContributorNav/ContributorNav.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import React from 'react';
import BackgroundButton from 'components/atoms/Button/BackgroundButton';
import Tab from 'components/atoms/Tab/Tab';
import Container from './Container';

Expand Down
8 changes: 4 additions & 4 deletions src/webext/createMessageHandler.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import MessageSender = chrome.runtime.MessageSender;

import { Action } from 'redux';
import { BaseAction } from '../app/actions';
import * as R from 'ramda';
import assocTabIfNotGiven from './assocTabIfNotGiven';
import { getSettingsUrl } from './openSettingsTab';

type MessageSender = chrome.runtime.MessageSender;
type Emit = (action: Action) => void;

const isAction = (x: any): x is Action => typeof x === 'object' && 'type' in x;
const isAction = (x: unknown): x is Action =>
typeof x === 'object' && 'type' in (x as object);

const isSettingsPage = (url: string): boolean => url.includes(getSettingsUrl());

Expand All @@ -25,7 +25,7 @@ const addSenderToAction = <A extends BaseAction>(
)(action);

const createMessageHandler = (emit: Emit) => (
action: any,
action: unknown,
sender: MessageSender
) => {
const fromText = sender.tab
Expand Down
2 changes: 1 addition & 1 deletion src/webext/openSettingsTab.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CreateProperties = chrome.tabs.CreateProperties;
type CreateProperties = chrome.tabs.CreateProperties;

export const getSettingsUrl = () => chrome.extension.getURL('settings.html');

Expand Down
2 changes: 1 addition & 1 deletion src/webext/sendMessageToBackground.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const sendMessageToBackground = (message: any): void => {
const sendMessageToBackground = (message: unknown): void => {
chrome.runtime.sendMessage(message);
};

Expand Down

0 comments on commit 5d8788b

Please sign in to comment.