Skip to content

Commit ad9f6e1

Browse files
christianalfoniCompuIves
authored andcommitted
Fix typing issues (#2831)
* Fix typing issues * Fix more ts issues * Fix another lint issue * Temporarily remove typings * Remove eslint ignores
1 parent 237a727 commit ad9f6e1

File tree

16 files changed

+62
-43
lines changed

16 files changed

+62
-43
lines changed

.eslintrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
"__DEV__": true,
1717
"Stripe": true
1818
},
19-
"settings": {
20-
"import/ignore": ["worker-loader/?", "sandbox-hooks"]
21-
},
2219
"rules": {
2320
"react/jsx-filename-extension": 0,
2421
"react/sort-comp": 0,

packages/app/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@
239239
"@types/react-dom": "^16.8.3",
240240
"@types/react-helmet": "^5.0.11",
241241
"@types/react-icons": "2.2.7",
242-
"@types/react-router-dom": "^5.1.0",
243242
"@types/react-stripe-elements": "^1.3.2",
244243
"@types/resolve": "^0.0.8",
245244
"@types/socket.io-client": "^1.4.32",

packages/app/src/app/components/CodeEditor/index.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
import React from 'react';
2-
import UIIcon from 'react-icons/lib/md/dvr';
3-
import QuestionIcon from 'react-icons/lib/go/question';
4-
import getUI from '@codesandbox/common/lib/templates/configuration/ui';
51
import Centered from '@codesandbox/common/lib/components/flex/Centered';
62
import Margin from '@codesandbox/common/lib/components/spacing/Margin';
7-
import isImage from '@codesandbox/common/lib/utils/is-image';
3+
import Tooltip from '@codesandbox/common/lib/components/Tooltip';
4+
import { getModulePath } from '@codesandbox/common/lib/sandbox/modules';
85
import getDefinition from '@codesandbox/common/lib/templates';
6+
import getUI from '@codesandbox/common/lib/templates/configuration/ui';
97
import { Sandbox } from '@codesandbox/common/lib/types';
10-
import { getModulePath } from '@codesandbox/common/lib/sandbox/modules';
11-
import Tooltip from '@codesandbox/common/lib/components/Tooltip';
12-
import { Title } from 'app/components/Title';
8+
import isImage from '@codesandbox/common/lib/utils/is-image';
139
import { SubTitle } from 'app/components/SubTitle';
10+
import { Title } from 'app/components/Title';
1411
import Loadable from 'app/utils/Loadable';
15-
import { ImageViewer } from './ImageViewer';
12+
import React from 'react';
13+
import QuestionIcon from 'react-icons/lib/go/question';
14+
import UIIcon from 'react-icons/lib/md/dvr';
15+
1616
import { Configuration } from './Configuration';
17-
import { VSCode } from './VSCode';
17+
import { Icon, Icons } from './elements';
18+
import { ImageViewer } from './ImageViewer';
1819
import MonacoDiff from './MonacoDiff';
1920
import { Props } from './types'; // eslint-disable-line
20-
import { Icons, Icon } from './elements';
21+
import { VSCode } from './VSCode';
2122

2223
const CodeMirror = Loadable(() =>
2324
import(/* webpackChunkName: 'codemirror-editor' */ './CodeMirror')
@@ -164,11 +165,13 @@ export class CodeEditor extends React.PureComponent<
164165
);
165166
}
166167

167-
let Editor: React.ComponentClass<Props> =
168-
settings.codeMirror && !props.isLive ? CodeMirror : Monaco;
168+
let Editor =
169+
settings.codeMirror && !props.isLive
170+
? ((CodeMirror as unknown) as React.ComponentClass<Props>)
171+
: ((Monaco as unknown) as React.ComponentClass<Props>);
169172

170173
if (settings.experimentVSCode) {
171-
Editor = VSCode;
174+
Editor = VSCode as React.ComponentClass<Props>;
172175
}
173176

174177
return (

packages/app/src/app/pages/Dashboard/Content/CreateNewSandbox/elements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const ButtonsContainer = styled.div`
3232
box-sizing: border-box;
3333
`;
3434

35-
export const Container = styled.div<{ hide: boolean }>`
35+
export const Container = styled.div<{ hide?: boolean }>`
3636
${({ color, hide, theme }) => css`
3737
display: flex;
3838
justify-content: center;

packages/app/src/app/pages/Search/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
ALGOLIA_APPLICATION_ID,
44
ALGOLIA_DEFAULT_INDEX,
55
} from '@codesandbox/common/lib/utils/config';
6-
import Helmet from 'react-helmet';
6+
import { Helmet } from 'react-helmet';
77
import MaxWidth from '@codesandbox/common/lib/components/flex/MaxWidth';
88
import Margin from '@codesandbox/common/lib/components/spacing/Margin';
99
import qs from 'qs';
@@ -14,7 +14,7 @@ import {
1414
PoweredBy,
1515
Configure,
1616
} from 'react-instantsearch/dom';
17-
import { History, Location} from 'history';
17+
import { History, Location } from 'history';
1818

1919
import { Navigation } from 'app/pages/common/Navigation';
2020
import { useOvermind } from 'app/overmind';

packages/app/src/app/pages/common/ErrorBoundary/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from 'react';
22
import { Location } from 'history';
3-
import { RouteComponentProps } from 'react-router';
43

54
export type ErrorInfo = {
65
componentStack: string;
@@ -11,10 +10,11 @@ export interface IFallbackComponentProps {
1110
trace?: string;
1211
}
1312

14-
export interface IErrorBoundaryProps extends RouteComponentProps {
13+
export interface IErrorBoundaryProps {
1514
children?: React.ReactNode;
1615
FallbackComponent?: React.ComponentType<IFallbackComponentProps>;
1716
onError?: (error: Error, trace: string) => void;
17+
location?: Location;
1818
}
1919

2020
export interface IErrorBoundaryState {

packages/app/src/sandbox/eval/presets/parcel/transpilers/html-transpiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @flow
2-
2+
// eslint-disable-next-line
33
import HTMLWorker from 'worker-loader?publicPath=/&name=parcel-html-transpiler.[hash:8].worker.js!./html-worker';
44
import type { LoaderContext } from '../../../transpiled-module';
55
import WorkerTranspiler from '../../../transpilers/worker-transpiler';

packages/app/src/sandbox/eval/transpilers/babel/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/* eslint-disable import/default */
12
// @ts-ignore
23
import BabelWorker from 'worker-loader?publicPath=/&name=babel-transpiler.[hash:8].worker.js!./worker/index';
4+
/* eslint-enable import/default */
35
import { isBabel7 } from '@codesandbox/common/lib/utils/is-babel-7';
46

57
import regexGetRequireStatements from './worker/simple-get-require-statements';

packages/app/src/sandbox/eval/transpilers/coffee/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/* eslint-disable import/default */
12
// @ts-ignore
23
import CoffeeWorker from 'worker-loader?publicPath=/&name=coffee-transpiler.[hash:8].worker.js!./coffee-worker';
4+
/* eslint-enable import/default */
35

46
import WorkerTranspiler from '../worker-transpiler';
57
import { LoaderContext } from '../../transpiled-module';

packages/app/src/sandbox/eval/transpilers/less/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
/* eslint-disable import/default */
12
// @ts-ignore
23
import LessWorker from 'worker-loader?publicPath=/&name=less-transpiler.[hash:8].worker.js!./less-worker';
4+
/* eslint-enable import/default */
35

46
import WorkerTranspiler from '../worker-transpiler';
57
import { LoaderContext } from '../../transpiled-module';

0 commit comments

Comments
 (0)