From 319369d1be5c9b7f6e5574942225137804a92b1e Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Wed, 23 Jan 2019 18:38:49 -0600 Subject: [PATCH] Fix remaining warnings for enabled files --- package.json | 2 +- src/components/views/right_panel/HeaderButtons.js | 1 - src/utils/PasswordScorer.js | 9 ++++++--- src/utils/Timer.js | 1 - 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index aca3d433ad..290adfef09 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "start:init": "babel src -d lib --source-maps --copy-files", "lint": "eslint src/", "lintall": "eslint src/ test/", - "lintwithexclusions": "eslint --max-warnings 13 --ignore-path .eslintignore.errorfiles src test", + "lintwithexclusions": "eslint --max-warnings 0 --ignore-path .eslintignore.errorfiles src test", "clean": "rimraf lib", "prepublish": "npm run clean && npm run build && git rev-parse HEAD > git-revision.txt", "test": "karma start --single-run=true --browsers ChromeHeadless", diff --git a/src/components/views/right_panel/HeaderButtons.js b/src/components/views/right_panel/HeaderButtons.js index f0479eb8be..3f5f58121d 100644 --- a/src/components/views/right_panel/HeaderButtons.js +++ b/src/components/views/right_panel/HeaderButtons.js @@ -78,7 +78,6 @@ export default class HeaderButtons extends React.Component { // till show_right_panel, just without the fromHeader flag // as that would hide the right panel again dis.dispatch(Object.assign({}, payload, {fromHeader: false})); - } this.setState({ phase: payload.phase, diff --git a/src/utils/PasswordScorer.js b/src/utils/PasswordScorer.js index 545686cdb6..647436c131 100644 --- a/src/utils/PasswordScorer.js +++ b/src/utils/PasswordScorer.js @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -import Zxcvbn from 'zxcvbn'; +import zxcvbn from 'zxcvbn'; import MatrixClientPeg from '../MatrixClientPeg'; import { _t, _td } from '../languageHandler'; @@ -59,6 +59,9 @@ _td("Short keyboard patterns are easy to guess"); * Wrapper around zxcvbn password strength estimation * Include this only from async components: it pulls in zxcvbn * (obviously) which is large. + * + * @param {string} password Password to score + * @returns {object} Score result with `score` and `feedback` properties */ export function scorePassword(password) { if (password.length === 0) return null; @@ -66,10 +69,10 @@ export function scorePassword(password) { const userInputs = ZXCVBN_USER_INPUTS.slice(); userInputs.push(MatrixClientPeg.get().getUserIdLocalpart()); - let zxcvbnResult = Zxcvbn(password, userInputs); + let zxcvbnResult = zxcvbn(password, userInputs); // Work around https://github.com/dropbox/zxcvbn/issues/216 if (password.includes(' ')) { - const resultNoSpaces = Zxcvbn(password.replace(/ /g, ''), userInputs); + const resultNoSpaces = zxcvbn(password.replace(/ /g, ''), userInputs); if (resultNoSpaces.score < zxcvbnResult.score) zxcvbnResult = resultNoSpaces; } diff --git a/src/utils/Timer.js b/src/utils/Timer.js index 6d6dbb0996..ca06237fbf 100644 --- a/src/utils/Timer.js +++ b/src/utils/Timer.js @@ -26,7 +26,6 @@ Once a timer is finished or aborted, it can't be started again a new one through `clone()` or `cloneIfRun()`. */ export default class Timer { - constructor(timeout) { this._timeout = timeout; this._onTimeout = this._onTimeout.bind(this);