Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
codehag committed Sep 28, 2017
1 parent 69cf7ab commit 299d064
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/actions/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,6 @@ export function clearHighlightLineRange() {
export function toggleConditionalBreakpointPanel(line?: number) {
return {
type: "TOGGLE_CONDITIONAL_BREAKPOINT_PANEL",
line: line
line: line
};
}
6 changes: 5 additions & 1 deletion src/components/Editor/EditorMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ function getMenuItems(
left: event.clientX
});

const sourceLocation = getSourceLocationFromMouseEvent(editor, selectedLocation, event)
const sourceLocation = getSourceLocationFromMouseEvent(
editor,
selectedLocation,
event
);

const pairedType = isOriginalId(selectedLocation.sourceId)
? L10N.getStr("generated")
Expand Down
8 changes: 6 additions & 2 deletions src/components/Editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,13 @@ class Editor extends PureComponent {
const { selectedLocation, jumpToMappedLocation } = this.props;

if (e.metaKey && e.altKey) {
const sourceLocation = getSourceLocationFromMouseEvent(this.state.editor, selectedLocation, e);
const sourceLocation = getSourceLocationFromMouseEvent(
this.state.editor,
selectedLocation,
e
);
jumpToMappedLocation(sourceLocation);
}
}
}

toggleConditionalPanel(line) {
Expand Down
5 changes: 1 addition & 4 deletions src/components/PrimaryPanes/SourcesTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,7 @@ class SourcesTree extends Component {
};

return (
<div
className="sources-list"
onKeyDown={onKeyDown}
>
<div className="sources-list" onKeyDown={onKeyDown}>
{tree}
</div>
);
Expand Down
17 changes: 6 additions & 11 deletions src/components/PrimaryPanes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,31 +109,26 @@ class PrimaryPanes extends Component {
const { selectSource } = this.props;

const outlineComp = isEnabled("outline") ? (
<Outline
selectSource={selectSource}
/>
<Outline selectSource={selectSource} />
) : null;

return outlineComp;
}

renderSources() {
const { sources, selectSource } = this.props;
return (
<SourcesTree
sources={sources}
selectSource={selectSource}
/>
);
return <SourcesTree sources={sources} selectSource={selectSource} />;
}

render() {
const { selectedPane } = this.state;

return (
<div className="sources-panel">
{this.renderTabs()}
{ selectedPane === "sources" ? this.renderSources() : this.renderOutline() }
{selectedPane === "sources"
? this.renderSources()
: this.renderOutline()}
</div>
);
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/SecondaryPanes/Breakpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ class Breakpoints extends PureComponent {
label: addConditionLabel,
accesskey: addConditionKey,
click: () => {
this.selectBreakpoint(breakpoint)
toggleConditionalBreakpointPanel(breakpoint.location.line)
this.selectBreakpoint(breakpoint);
toggleConditionalBreakpointPanel(breakpoint.location.line);
}
};

Expand All @@ -276,8 +276,8 @@ class Breakpoints extends PureComponent {
label: editConditionLabel,
accesskey: editConditionKey,
click: () => {
this.selectBreakpoint(breakpoint)
toggleConditionalBreakpointPanel(breakpoint.location.line)
this.selectBreakpoint(breakpoint);
toggleConditionalBreakpointPanel(breakpoint.location.line);
}
};

Expand Down
10 changes: 5 additions & 5 deletions src/utils/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ function lineAtHeight(editor, sourceId, event) {

function getSourceLocationFromMouseEvent(editor, selectedLocation, e) {
const { line, ch } = editor.codeMirror.coordsChar({
left: e.clientX,
top: e.clientY
left: e.clientX,
top: e.clientY
});

return {
sourceId: selectedLocation.sourceId,
line: line + 1,
column: ch + 1
sourceId: selectedLocation.sourceId,
line: line + 1,
column: ch + 1
};
}

Expand Down
1 change: 0 additions & 1 deletion src/utils/sources-tree/tests/utils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,5 +212,4 @@ describe("sources tree", () => {
).toBe(true);
});
});

});
6 changes: 3 additions & 3 deletions src/utils/sources-tree/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ export function isDirectory(url: Object) {
}

export function isNotJavaScript(source: Object): boolean {
const parsedUrl = parse(source.url).pathname
const parsedUrl = parse(source.url).pathname;
if (!parsedUrl) {
return false;
}
const parsedExtension = parsedUrl.split('.').pop();
const parsedExtension = parsedUrl.split(".").pop();

return ["css", "svg", "png"].includes(parsedExtension)
return ["css", "svg", "png"].includes(parsedExtension);
}

export function isInvalidUrl(url: Object, source: Object) {
Expand Down

0 comments on commit 299d064

Please sign in to comment.