diff --git a/.eslintrc.js b/.eslintrc.js index 132caa6..bd5a90a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -21,6 +21,7 @@ module.exports = { "plugin:flowtype/recommended", ], rules: { + "prefer-const": ["warn"], camelcase: ["error", {properties: "never", allow: ["^_unused_.*"]}], eqeqeq: ["error", "always", {null: "ignore"}], "no-unused-vars": [ diff --git a/src/core/algorithm/markovChain.js b/src/core/algorithm/markovChain.js index c868b73..54d2722 100644 --- a/src/core/algorithm/markovChain.js +++ b/src/core/algorithm/markovChain.js @@ -203,7 +203,7 @@ export function findStationaryDistribution( params: PagerankParams, options: PagerankOptions ): Promise { - let gen = findStationaryDistributionGenerator(params, { + const gen = findStationaryDistributionGenerator(params, { verbose: options.verbose, convergenceThreshold: options.convergenceThreshold, maxIterations: options.maxIterations, diff --git a/src/explorer/legacy/pagerankTable/Table.test.js b/src/explorer/legacy/pagerankTable/Table.test.js index 483e618..fb405dd 100644 --- a/src/explorer/legacy/pagerankTable/Table.test.js +++ b/src/explorer/legacy/pagerankTable/Table.test.js @@ -84,7 +84,7 @@ describe("explorer/legacy/pagerankTable/Table", () => { const {element} = await setup(); findButton(element).simulate("click"); findButton(element).simulate("click"); - let button = findButton(element); + const button = findButton(element); expect(button.text()).toEqual("Show weight configuration"); expect(element.find({"data-test-weight-config": true})).toHaveLength(0); }); diff --git a/src/plugins/git/edges.js b/src/plugins/git/edges.js index fd2a5ab..63849b1 100644 --- a/src/plugins/git/edges.js +++ b/src/plugins/git/edges.js @@ -75,7 +75,7 @@ function lengthDecode( } function multiLengthDecode(x: $ReadOnlyArray, fail: () => Error) { let remaining = x; - let partses = []; + const partses = []; while (remaining.length > 0) { const {parts, rest} = lengthDecode(remaining, fail); partses.push(parts); diff --git a/src/plugins/github/edges.js b/src/plugins/github/edges.js index 6d47b4c..c0a1e13 100644 --- a/src/plugins/github/edges.js +++ b/src/plugins/github/edges.js @@ -177,7 +177,7 @@ function lengthDecode( } function multiLengthDecode(x: $ReadOnlyArray, fail: () => Error) { let remaining = x; - let partses = []; + const partses = []; while (remaining.length > 0) { const {parts, rest} = lengthDecode(remaining, fail); partses.push(parts); diff --git a/src/plugins/github/relationalView.test.js b/src/plugins/github/relationalView.test.js index 24bc2b7..f78d726 100644 --- a/src/plugins/github/relationalView.test.js +++ b/src/plugins/github/relationalView.test.js @@ -299,7 +299,7 @@ describe("plugins/github/relationalView", () => { } function commitChain(n: number): T.Commit[] { let head = wrapCommit(0, []); - let results = [head]; + const results = [head]; for (let i = 1; i < n; i++) { head = wrapCommit(i, [head]); results.push(head); @@ -307,7 +307,7 @@ describe("plugins/github/relationalView", () => { return results; } const commits = commitChain(COMMIT_CHAIN_LENGTH); - let pullRequests: T.PullRequest[] = []; + const pullRequests: T.PullRequest[] = []; function pullRequest( prNumber: number, mergeCommit: T.Commit