chore: add prettier frontent linter

This commit is contained in:
Oleg Lobanov
2021-03-21 12:51:58 +01:00
parent a721dc1f31
commit c44b37c50c
73 changed files with 18898 additions and 4499 deletions

View File

@@ -1,83 +1,87 @@
import * as i18n from '@/i18n'
import moment from 'moment'
import * as i18n from "@/i18n";
import moment from "moment";
const mutations = {
closeHovers: state => {
state.show = null
state.showConfirm = null
closeHovers: (state) => {
state.show = null;
state.showConfirm = null;
},
toggleShell: (state) => {
state.showShell = !state.showShell
state.showShell = !state.showShell;
},
showHover: (state, value) => {
if (typeof value !== 'object') {
state.show = value
return
if (typeof value !== "object") {
state.show = value;
return;
}
state.show = value.prompt
state.showConfirm = value.confirm
state.show = value.prompt;
state.showConfirm = value.confirm;
},
showError: (state) => {
state.show = 'error'
state.show = "error";
},
showSuccess: (state) => {
state.show = 'success'
state.show = "success";
},
setLoading: (state, value) => {
state.loading = value;
},
setReload: (state, value) => {
state.reload = value;
},
setLoading: (state, value) => { state.loading = value },
setReload: (state, value) => { state.reload = value },
setUser: (state, value) => {
if (value === null) {
state.user = null
return
state.user = null;
return;
}
let locale = value.locale
let locale = value.locale;
if (locale === '') {
locale = i18n.detectLocale()
if (locale === "") {
locale = i18n.detectLocale();
}
moment.locale(locale)
i18n.default.locale = locale
state.user = value
moment.locale(locale);
i18n.default.locale = locale;
state.user = value;
},
setJWT: (state, value) => (state.jwt = value),
multiple: (state, value) => (state.multiple = value),
addSelected: (state, value) => (state.selected.push(value)),
addSelected: (state, value) => state.selected.push(value),
removeSelected: (state, value) => {
let i = state.selected.indexOf(value)
if (i === -1) return
state.selected.splice(i, 1)
let i = state.selected.indexOf(value);
if (i === -1) return;
state.selected.splice(i, 1);
},
resetSelected: (state) => {
state.selected = []
state.selected = [];
},
updateUser: (state, value) => {
if (typeof value !== 'object') return
if (typeof value !== "object") return;
for (let field in value) {
if (field === 'locale') {
moment.locale(value[field])
i18n.default.locale = value[field]
if (field === "locale") {
moment.locale(value[field]);
i18n.default.locale = value[field];
}
state.user[field] = value[field]
state.user[field] = value[field];
}
},
updateRequest: (state, value) => {
state.oldReq = state.req
state.req = value
state.oldReq = state.req;
state.req = value;
},
updateClipboard: (state, value) => {
state.clipboard.key = value.key
state.clipboard.items = value.items
state.clipboard.path = value.path
state.clipboard.key = value.key;
state.clipboard.items = value.items;
state.clipboard.path = value.path;
},
resetClipboard: (state) => {
state.clipboard.key = ''
state.clipboard.items = []
}
}
state.clipboard.key = "";
state.clipboard.items = [];
},
};
export default mutations
export default mutations;