Skip to content

Commit c2ea7d0

Browse files
Jason LasterjasonLaster
Jason Laster
authored andcommitted
[sync] Bug 1530441 - Enable eslint locally. r=dwalsh
1 parent 329464b commit c2ea7d0

File tree

18 files changed

+18
-31
lines changed

18 files changed

+18
-31
lines changed

.eslintrc

+3-1
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,8 @@
442442
],
443443
"block",
444444
["-\\*-(.*)-\\*-", "eslint(.*)", "vim(.*)"]
445-
]
445+
],
446+
"consistent-return": "off",
447+
446448
}
447449
}

assets/dictionary.txt

+4-5
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,9 @@ asyncStore
208208
CPG
209209
TodoMVC
210210
pseudocode
211-
TravisCI
212-
30-60minutes
213-
myScriptFunction
214-
Homebrew
215211
Amit
216-
Zur
217212
Zur's
213+
TravisCI
214+
Homebrew
215+
30-60minutes
216+
myScriptFunction

assets/panel/panel.js

-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */
44

5-
const { Task } = require("devtools/shared/task");
65
const { LocalizationHelper } = require("devtools/shared/l10n");
7-
const { gDevTools } = require("devtools/client/framework/devtools");
86
const {
97
gDevToolsBrowser
108
} = require("devtools/client/framework/devtools-browser");
11-
const { TargetFactory } = require("devtools/client/framework/target");
12-
const { Toolbox } = require("devtools/client/framework/toolbox");
139
loader.lazyRequireGetter(
1410
this,
1511
"openContentLink",

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "debugger.html",
2+
"name": "debugger",
33
"version": "0.6.0",
44
"license": "MPL-2.0",
55
"repository": {
@@ -26,7 +26,7 @@
2626
"lint:css": "stylelint \"src/components/**/*.css\"",
2727
"lint:js": "eslint *.js \"src/**/*.js\" \"packages/*/src/**/*.js\" --fix",
2828
"lint:jsx-a11y": "eslint *.js \"src/**/*.js\" \"packages/*/src/**/*.js\" --plugin=jsx-a11y --config=.eslintrc.jsx-a11y",
29-
"lint:md": "remark -u devtools-linters/markdown/preset -qf *.md src configs docs",
29+
"lint:md": "remark -u devtools-linters/markdown/preset -qf *.md src",
3030
"mochi": "mochii --mc ./firefox --interactive --default-test-path devtools/client/debugger/new",
3131
"mochid": "yarn mochi -- --jsdebugger --",
3232
"mochir": "yarn mochi -- --repeat 10 --",

packages/devtools-components/src/tree.js

-1
Original file line numberDiff line numberDiff line change
@@ -829,7 +829,6 @@ class Tree extends Component {
829829
if (this.treeRef.current !== document.activeElement) {
830830
this.treeRef.current.focus();
831831
}
832-
return;
833832
}
834833
}
835834

packages/devtools-reps/src/object-inspector/components/ObjectInspector.js

-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ class ObjectInspector extends Component<Props> {
9898
if (this.props.rootsChanged) {
9999
this.props.rootsChanged();
100100
}
101-
return;
102101
}
103102
}
104103

packages/devtools-source-map/src/tests/helpers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async function setupBundleFixture(name) {
3535
return { content };
3636
});
3737

38-
return await getOriginalURLs(source);
38+
return getOriginalURLs(source);
3939
}
4040

4141
module.exports = {

src/actions/sources/select.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export function selectSource(
9393
) {
9494
return async ({ dispatch }: ThunkArgs) => {
9595
const location = createLocation({ ...options, sourceId });
96-
return await dispatch(selectSpecificLocation(location));
96+
return dispatch(selectSpecificLocation(location));
9797
};
9898
}
9999

src/components/App.js

-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ class App extends Component<Props, State> {
191191
return;
192192
}
193193
openQuickOpen();
194-
return;
195194
};
196195

197196
onLayoutChange = () => {

src/main.js

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// @flow
66

77
import ReactDOM from "react-dom";
8-
98
import { onConnect } from "./client";
109
import { teardownWorkers } from "./utils/bootstrap";
1110
import sourceQueue from "./utils/source-queue";

src/reducers/sources.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,7 @@ import {
2222
import { originalToGeneratedId } from "devtools-source-map";
2323
import { prefs } from "../utils/prefs";
2424

25-
import type {
26-
Source,
27-
SourceId,
28-
SourceLocation,
29-
ThreadId,
30-
WorkerList
31-
} from "../types";
25+
import type { Source, SourceId, SourceLocation, ThreadId } from "../types";
3226
import type { PendingSelectedLocation, Selector } from "./types";
3327
import type { Action, DonePromiseAction, FocusItem } from "../actions/types";
3428
import type { LoadSourceAction } from "../actions/types/SourceAction";

src/selectors/getCallStackFrames.js

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export function formatCallStackFrames(
6363
return annotateFrames(formattedFrames);
6464
}
6565

66+
// eslint-disable-next-line
6667
export const getCallStackFrames: State => Frame[] = (createSelector: any)(
6768
getFrames,
6869
getSources,

src/test/tests-setup.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function getL10nBundle() {
4646
try {
4747
return read("../../assets/panel/debugger.properties");
4848
} catch (e) {
49-
return read("../../../../locales/en-us/debugger.properties");
49+
return read("../../../../locales/en-US/debugger.properties");
5050
}
5151
}
5252

src/utils/build-query.js

-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ function buildFlags(caseSensitive: boolean, isGlobal: boolean): ?RegExp$flags {
4242
if (!caseSensitive && !isGlobal) {
4343
return "i";
4444
}
45-
46-
return;
4745
}
4846

4947
export default function buildQuery(

src/utils/path.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function dirname(path: string) {
1414
}
1515

1616
export function isURL(str: string) {
17-
return str.indexOf("://") !== -1;
17+
return str.includes("://");
1818
}
1919

2020
export function isAbsolute(str: string) {

src/utils/sources-tree/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function isNotJavaScript(source: Source): boolean {
6464

6565
export function isInvalidUrl(url: Object, source: Source) {
6666
return (
67-
IGNORED_URLS.indexOf(url) != -1 ||
67+
IGNORED_URLS.includes(url) ||
6868
!source.url ||
6969
!url.group ||
7070
isPretty(source) ||

src/utils/tests/telemetry.spec.js

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ describe("telemetry.recordEvent()", () => {
2727
"debugger",
2828
null,
2929
{
30+
// eslint-disable-next-line camelcase
3031
session_id: -1,
3132
bar: 1
3233
}

src/workers/pretty-print/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function prettyPrint({ source, url }: PrettyPrintOpts) {
2626

2727
assert(isJavaScript(source), "Can't prettify non-javascript files.");
2828

29-
return await _prettyPrint({
29+
return _prettyPrint({
3030
url,
3131
indent,
3232
sourceText: source.text

0 commit comments

Comments
 (0)