Fix remaining warnings for enabled files
parent
9470424bcb
commit
319369d1be
|
@ -48,7 +48,7 @@
|
||||||
"start:init": "babel src -d lib --source-maps --copy-files",
|
"start:init": "babel src -d lib --source-maps --copy-files",
|
||||||
"lint": "eslint src/",
|
"lint": "eslint src/",
|
||||||
"lintall": "eslint src/ test/",
|
"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",
|
"clean": "rimraf lib",
|
||||||
"prepublish": "npm run clean && npm run build && git rev-parse HEAD > git-revision.txt",
|
"prepublish": "npm run clean && npm run build && git rev-parse HEAD > git-revision.txt",
|
||||||
"test": "karma start --single-run=true --browsers ChromeHeadless",
|
"test": "karma start --single-run=true --browsers ChromeHeadless",
|
||||||
|
|
|
@ -78,7 +78,6 @@ export default class HeaderButtons extends React.Component {
|
||||||
// till show_right_panel, just without the fromHeader flag
|
// till show_right_panel, just without the fromHeader flag
|
||||||
// as that would hide the right panel again
|
// as that would hide the right panel again
|
||||||
dis.dispatch(Object.assign({}, payload, {fromHeader: false}));
|
dis.dispatch(Object.assign({}, payload, {fromHeader: false}));
|
||||||
|
|
||||||
}
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
phase: payload.phase,
|
phase: payload.phase,
|
||||||
|
|
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import Zxcvbn from 'zxcvbn';
|
import zxcvbn from 'zxcvbn';
|
||||||
|
|
||||||
import MatrixClientPeg from '../MatrixClientPeg';
|
import MatrixClientPeg from '../MatrixClientPeg';
|
||||||
import { _t, _td } from '../languageHandler';
|
import { _t, _td } from '../languageHandler';
|
||||||
|
@ -59,6 +59,9 @@ _td("Short keyboard patterns are easy to guess");
|
||||||
* Wrapper around zxcvbn password strength estimation
|
* Wrapper around zxcvbn password strength estimation
|
||||||
* Include this only from async components: it pulls in zxcvbn
|
* Include this only from async components: it pulls in zxcvbn
|
||||||
* (obviously) which is large.
|
* (obviously) which is large.
|
||||||
|
*
|
||||||
|
* @param {string} password Password to score
|
||||||
|
* @returns {object} Score result with `score` and `feedback` properties
|
||||||
*/
|
*/
|
||||||
export function scorePassword(password) {
|
export function scorePassword(password) {
|
||||||
if (password.length === 0) return null;
|
if (password.length === 0) return null;
|
||||||
|
@ -66,10 +69,10 @@ export function scorePassword(password) {
|
||||||
const userInputs = ZXCVBN_USER_INPUTS.slice();
|
const userInputs = ZXCVBN_USER_INPUTS.slice();
|
||||||
userInputs.push(MatrixClientPeg.get().getUserIdLocalpart());
|
userInputs.push(MatrixClientPeg.get().getUserIdLocalpart());
|
||||||
|
|
||||||
let zxcvbnResult = Zxcvbn(password, userInputs);
|
let zxcvbnResult = zxcvbn(password, userInputs);
|
||||||
// Work around https://github.com/dropbox/zxcvbn/issues/216
|
// Work around https://github.com/dropbox/zxcvbn/issues/216
|
||||||
if (password.includes(' ')) {
|
if (password.includes(' ')) {
|
||||||
const resultNoSpaces = Zxcvbn(password.replace(/ /g, ''), userInputs);
|
const resultNoSpaces = zxcvbn(password.replace(/ /g, ''), userInputs);
|
||||||
if (resultNoSpaces.score < zxcvbnResult.score) zxcvbnResult = resultNoSpaces;
|
if (resultNoSpaces.score < zxcvbnResult.score) zxcvbnResult = resultNoSpaces;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ Once a timer is finished or aborted, it can't be started again
|
||||||
a new one through `clone()` or `cloneIfRun()`.
|
a new one through `clone()` or `cloneIfRun()`.
|
||||||
*/
|
*/
|
||||||
export default class Timer {
|
export default class Timer {
|
||||||
|
|
||||||
constructor(timeout) {
|
constructor(timeout) {
|
||||||
this._timeout = timeout;
|
this._timeout = timeout;
|
||||||
this._onTimeout = this._onTimeout.bind(this);
|
this._onTimeout = this._onTimeout.bind(this);
|
||||||
|
|
Loading…
Reference in New Issue