eslinted
This commit is contained in:
@@ -6,6 +6,7 @@ module.exports = {
|
||||
},
|
||||
globals: {
|
||||
Vue: 'readonly',
|
||||
LZString: 'readonly',
|
||||
},
|
||||
extends: [ 'eslint:recommended' ],
|
||||
parserOptions: {
|
||||
|
||||
@@ -31,14 +31,14 @@ const utils = {
|
||||
return output;
|
||||
},
|
||||
shuffle: function (array) {
|
||||
const output = [...array];
|
||||
const output = [ ...array ];
|
||||
if (output.length < 2) {
|
||||
return output;
|
||||
}
|
||||
for (let i = 0; i < array.length; i++) {
|
||||
const i1 = this.randindex(array);
|
||||
const i2 = this.randindex(array, i1);
|
||||
[output[i1], output[i2]] = [output[i2], output[i1]];
|
||||
[ output[i1], output[i2] ] = [ output[i2], output[i1] ];
|
||||
}
|
||||
return output;
|
||||
},
|
||||
@@ -50,14 +50,14 @@ const utils = {
|
||||
let app = {
|
||||
data() {
|
||||
return {
|
||||
question: "",
|
||||
answer: "",
|
||||
question: '',
|
||||
answer: '',
|
||||
showAnswer: false,
|
||||
available: [],
|
||||
current: [],
|
||||
failed: [],
|
||||
done: [],
|
||||
newRow: ["", ""],
|
||||
newRow: [ '', '' ],
|
||||
showConfig: true,
|
||||
};
|
||||
},
|
||||
@@ -71,7 +71,7 @@ let app = {
|
||||
},
|
||||
methods: {
|
||||
showApp() {
|
||||
document.getElementById("app").setAttribute("style", "");
|
||||
document.getElementById('app').setAttribute('style', '');
|
||||
},
|
||||
show() {
|
||||
this.showAnswer = true;
|
||||
@@ -93,7 +93,7 @@ let app = {
|
||||
addRow() {
|
||||
if (this.newRow[0] && this.newRow[1]) {
|
||||
this.available.push(utils.cloneObject(this.newRow));
|
||||
this.newRow = ["", ""];
|
||||
this.newRow = [ '', '' ];
|
||||
}
|
||||
this.reset();
|
||||
},
|
||||
@@ -119,8 +119,8 @@ let app = {
|
||||
},
|
||||
beforeMount() {
|
||||
const url = new URL(window.location);
|
||||
if (url.searchParams.get("d")) {
|
||||
this.available = utils.deserialize(url.searchParams.get("d"));
|
||||
if (url.searchParams.get('d')) {
|
||||
this.available = utils.deserialize(url.searchParams.get('d'));
|
||||
this.showConfig = false;
|
||||
this.reset();
|
||||
}
|
||||
@@ -128,9 +128,9 @@ let app = {
|
||||
updated() {
|
||||
const data = utils.serialize(this.available);
|
||||
const url = new URL(window.location);
|
||||
if (url.searchParams.get("d") !== data) {
|
||||
url.searchParams.set("d", data);
|
||||
window.history.pushState({}, "", url);
|
||||
if (url.searchParams.get('d') !== data) {
|
||||
url.searchParams.set('d', data);
|
||||
window.history.pushState({}, '', url);
|
||||
}
|
||||
},
|
||||
mounted: function () {
|
||||
@@ -140,5 +140,5 @@ let app = {
|
||||
|
||||
window.onload = () => {
|
||||
app = Vue.createApp(app);
|
||||
app.mount("#app");
|
||||
app.mount('#app');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user