Skip to content

Commit

Permalink
Add lint task
Browse files Browse the repository at this point in the history
Fix various indentation issues
  • Loading branch information
MaKleSoft committed Jun 16, 2017
1 parent 4ab0b61 commit 7662ac7
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 40 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
@@ -0,0 +1,5 @@
node_modules
app/bower_components
app/src/padlock.js
app/src/components
test
2 changes: 1 addition & 1 deletion .eslintrc.json
Expand Up @@ -28,7 +28,7 @@
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-loop-func": "error",
"no-multi-spaces": "error",
"no-multiple-empty-lines": ["error", {"max": 1, "maxBOF": 0, "maxEOF": 0}],
"no-multiple-empty-lines": ["error", {"max": 1, "maxBOF": 1, "maxEOF": 0}],
"no-spaced-func": "error",
"no-trailing-spaces": "error",
"no-undef": "error",
Expand Down
10 changes: 5 additions & 5 deletions app/src/ui/cloud-view/cloud-view.html
Expand Up @@ -330,7 +330,7 @@
this.prompt("It seems that your Padlock Cloud account uses a different master " +
"password than then one you are using on this device. Please provide the " +
"correct master password for your Padlock Cloud account!",
"Enter Master Password", "password", "Submit")
"Enter Master Password", "password", "Submit")
.then((pwd) => {
if (pwd === null) {
return;
Expand Down Expand Up @@ -365,10 +365,10 @@
if (this.settings.syncCustomHost) {
this.confirm("Are you sure you want to use a custom server for synchronization? " +
"This option is only recommended for advanced users!", "Continue").then((confirmed) => {
if (!confirmed) {
this.set("settings.syncCustomHost", false);
}
});
if (!confirmed) {
this.set("settings.syncCustomHost", false);
}
});
}
}

Expand Down
32 changes: 16 additions & 16 deletions app/src/ui/settings-view/settings-view.html
Expand Up @@ -256,7 +256,7 @@
_getEncryptedData() {
return this.prompt("Please choose a password to protect your data. This may be the same as your master " +
" password or something else, but make sure it is sufficiently strong!",
"Enter Password", "password", "Confirm", "Cancel")
"Enter Password", "password", "Confirm", "Cancel")
.then((pwd) => {
if (!pwd) {
if (pwd === "") {
Expand All @@ -269,12 +269,12 @@
"attackers to break the encryption used to protect your data. Try to use a longer " +
"password or include a variation of uppercase, lowercase and special characters as " +
"well as numbers.", "Use Anyway", "Try Again").then((confirm) => {
if (!confirm) {
return Promise.reject();
}
if (!confirm) {
return Promise.reject();
}

return padlock.exp.toPadlock(this.collection.records, pwd);
});
return padlock.exp.toPadlock(this.collection.records, pwd);
});
} else {
return padlock.exp.toPadlock(this.collection.records, pwd);
}
Expand Down Expand Up @@ -325,16 +325,16 @@
_importFromClipboard() {
padlock.platform.getClipboard()
.then((str) => this._importString(str))
.catch((e) => {
switch (e.code) {
case "decryption_failed":
this.alert("Failed to decrypt data. Did you enter the correct password?");
break;
default:
this.alert("No supported data found in clipboard. Please make sure to copy " +
.catch((e) => {
switch (e.code) {
case "decryption_failed":
this.alert("Failed to decrypt data. Did you enter the correct password?");
break;
default:
this.alert("No supported data found in clipboard. Please make sure to copy " +
"you data to the clipboard first (e.g. via ctrl + C).");
}
});
}
});
}

_importString(rawStr) {
Expand Down Expand Up @@ -364,7 +364,7 @@
} else if (isCSV) {
return this.confirm("The data you want to import seems to be in CSV format. Before you continue, " +
"please make sure that the data is structured according to Padlocks specific requirements!",
"Continue", "Review Import Guidelines")
"Continue", "Review Import Guidelines")
.then((confirm) => {
if (confirm) {
return imp.fromCSV(rawStr);
Expand Down
28 changes: 14 additions & 14 deletions app/src/ui/start-view/start-view.html
Expand Up @@ -222,13 +222,13 @@
this.confirm("WARNING: The password you entered is weak which makes it easier for attackers to break " +
"the encryption used to protect your data. Try to use a longer password or include a " +
"variation of uppercase, lowercase and special characters as well as numbers.",
"Use Anyway", "Try Again").then((confirm) => {
if (confirm) {
this._confirmPassword();
} else {
this.$.newPasswordInput.focus();
}
});
"Use Anyway", "Try Again").then((confirm) => {
if (confirm) {
this._confirmPassword();
} else {
this.$.newPasswordInput.focus();
}
});
return;
}

Expand All @@ -240,13 +240,13 @@
"not even we! This is to ensure that your data is as safe as possible but it also means " +
"that if you lose your master password, we won't be able to assist you with recovering your " +
"data.", "password", "Repeat Master Password", "Confirm").then((pwd) => {
if (pwd === this.$.newPasswordInput.value) {
this._initializeData();
} else {
this.alert("You failed to repeat the password correctly. Try again!")
.then(() => this.$.newPasswordInput.focus());
}
});
if (pwd === this.$.newPasswordInput.value) {
this._initializeData();
} else {
this.alert("You failed to repeat the password correctly. Try again!")
.then(() => this.$.newPasswordInput.focus());
}
});
}

_initializeData() {
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -23,7 +23,7 @@
"electron": "^1.6.10",
"electron-builder": "^18.8.1",
"eslint": "^4.0.0",
"eslint-plugin-html": "^1.7.0",
"eslint-plugin-html": "^3.0.0",
"fs-extra": "^1.0.0",
"gulp": "^3.9.1",
"gulp-insert-lines": "0.0.4",
Expand All @@ -46,6 +46,7 @@
"bower-install": "pushd app && bower install && popd app",
"compile": "gulp compile --silent",
"debug": "gulp --silent --watch",
"lint": "eslint app/**/*.{js,html}",
"test": "npm run compile && mocha --ui tdd",
"start": "gulp build --electron && electron dist/electron",
"postinstall": "npm run bower-install && npm run compile"
Expand Down

0 comments on commit 7662ac7

Please sign in to comment.