Skip to content

Commit 4973c62

Browse files
authored
Merge pull request #194 from ActivityWatch/dev/eslint-fix
2 parents 7242bed + 187c7e5 commit 4973c62

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

.eslintrc.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@
2020
"@typescript-eslint/no-var-requires": ["off"],
2121
"@typescript-eslint/no-explicit-any": ["off"],
2222
"@typescript-eslint/no-use-before-define": "warn",
23-
"@typescript-eslint/no-this-alias": "warn",
23+
"@typescript-eslint/no-unused-vars": ["warn", {"argsIgnorePattern": "^_"}],
24+
"@typescript-eslint/no-this-alias": [
25+
"warn",
26+
{
27+
"allowDestructuring": true,
28+
"allowedNames": ["that"]
29+
}
30+
],
2431
"prefer-rest-params": "warn",
2532
"no-shadow": [
2633
"warn",

src/components/CategoryEditTree.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ div
1111
span(v-if="cls.rule.type === 'regex'") Rule ({{cls.rule.type}}): #[code {{cls.rule.regex}}]
1212
span(v-else, style="color: #888") No rule
1313
span.float-right
14-
b-btn.ml-1(size="sm", variant="outline-secondary", @click="showEditModal($event)" style="border: 0;" pill)
14+
b-btn.ml-1(size="sm", variant="outline-secondary", @click="showEditModal()" style="border: 0;" pill)
1515
icon(name="edit")
1616
b-btn.ml-1(size="sm", variant="outline-success", @click="addSubclass(cls)" style="border: 0;" pill)
1717
icon(name="plus")
@@ -103,7 +103,7 @@ export default {
103103
// TODO: Move button to edit modal?
104104
this.$store.commit('settings/removeClass', cls);
105105
},
106-
showEditModal(event) {
106+
showEditModal() {
107107
this.$refs.edit.show();
108108
},
109109
checkFormValidity() {

src/components/ErrorBoundary.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ export default {
1111
name: 'ErrorBoundary',
1212
data() {
1313
return {
14-
errors: []
14+
errors: [],
1515
};
1616
},
17-
errorCaptured(err, vm, info) {
17+
errorCaptured(err, _vm, _info) {
1818
// console.error("Error captured!");
1919
// console.error(err, vm, info);
2020

src/mixins/asyncErrorCaptured.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@ function handleError(error, vm, info) {
1515

1616
export default {
1717
beforeCreate: function() {
18-
const _self = this;
18+
const that = this;
1919
const methods = this.$options.methods || {};
20-
for (var key in methods) {
21-
var original = methods[key];
22-
methods[key] = function() {
20+
for (const key in methods) {
21+
const original = methods[key];
22+
methods[key] = function(...args) {
2323
try {
24-
const result = original.apply(this, arguments);
24+
const result = original.apply(this, args);
2525
// let's analyse what is returned from the method
2626
if (result && typeof result.then === 'function' && typeof result.catch === 'function') {
2727
// this looks like a Promise. let's handle it's errors:
2828
return result.catch(function(err) {
29-
handleError(err, _self, key);
29+
handleError(err, that, key);
3030
});
3131
} else return result;
3232
} catch (e) {
33-
handleError(e, _self, key);
33+
handleError(e, that, key);
3434
}
3535
};
3636
}

0 commit comments

Comments
 (0)