Skip to content

Commit 2605068

Browse files
lbogdanCompuIves
authored andcommitted
Fix eslint errors for src/embed. (codesandbox#172)
1 parent 885ceed commit 2605068

File tree

4 files changed

+17
-14
lines changed

4 files changed

+17
-14
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@
161161
"start": "cross-env LOCAL_SERVER=1 node scripts/start.js",
162162
"start:dev_api": "node scripts/start.js",
163163
"build": "cross-env NODE_ENV=production node scripts/build.js && gulp",
164-
"test": "npm run lint:app && jest --env=jsdom",
164+
"test": "npm run lint && jest --env=jsdom",
165+
"lint": "npm run lint:app && npm run lint:embed",
165166
"test:watch": "jest --watch --env=jsdom",
166167
"lint:app": "eslint src/app",
167168
"typecheck": "flow check",

src/embed/App.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ import styled, { ThemeProvider } from 'styled-components';
44
import { camelizeKeys } from 'humps';
55
import 'whatwg-fetch';
66

7-
import type { Sandbox, Module } from 'common/types';
7+
import type { Sandbox } from 'common/types';
88
import getTemplateDefinition from 'common/templates';
99
import Centered from 'app/components/flex/Centered';
1010
import Title from 'app/components/text/Title';
1111
import SubTitle from 'app/components/text/SubTitle';
12+
import {
13+
findCurrentModule,
14+
findMainModule,
15+
} from 'app/store/entities/sandboxes/modules/selectors';
1216

1317
import Header from './components/Header';
1418
import Content from './components/Content';
1519
import Sidebar from './components/Sidebar';
1620
import { getSandboxOptions } from '../common/url';
17-
import {
18-
findCurrentModule,
19-
findMainModule,
20-
} from 'app/store/entities/sandboxes/modules/selectors';
2121

2222
const Container = styled.div`
2323
display: flex;

src/embed/components/Content.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ type Props = {
3737
autoResize: boolean,
3838
fontSize: number,
3939
initialPath: ?string,
40-
setCurrentModule: id => void,
40+
setCurrentModule: (moduleId: string) => void,
41+
setProjectView: (id: string, isInProjectView: boolean) => any,
4142
};
4243

4344
type State = {
@@ -154,12 +155,13 @@ export default class Content extends React.PureComponent<Props, State> {
154155
livePreviewEnabled: true,
155156
};
156157

157-
getPreferences = () => {
158-
return { ...this.preferences, fontSize: this.props.fontSize };
159-
};
158+
getPreferences = () => ({
159+
...this.preferences,
160+
fontSize: this.props.fontSize,
161+
});
160162

161-
setCurrentModule = (_, id) => {
162-
this.props.setCurrentModule(id);
163+
setCurrentModule = (_, moduleId) => {
164+
this.props.setCurrentModule(moduleId);
163165
};
164166

165167
render() {

src/embed/components/EditorLink.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Logo from 'app/components/Logo';
55
import { sandboxUrl } from 'app/utils/url-generator';
66

77
type Props = {
8-
id: string,
8+
sandbox: string,
99
small: boolean,
1010
};
1111

@@ -30,7 +30,7 @@ export default ({ sandbox, small }: Props) => (
3030
small={small}
3131
target="_blank"
3232
rel="noopener noreferrer"
33-
href={sandboxUrl(sandbox) + '?from-embed'}
33+
href={`${sandboxUrl(sandbox)}?from-embed`}
3434
>
3535
<Text small={small}>Edit on CodeSandbox</Text>
3636
<Logo />

0 commit comments

Comments
 (0)