mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: update eslint rules
This commit is contained in:
1 parent
0e07c64cad
commit
5e8d2b1286
30 files changed
+73
-72
No files matched your search
@@ -93,29 +93,25 @@ pjax.request = async (opt) => {
|
||||
data.fragments.forEach((fragment) => {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (fragment.html === undefined) {
|
||||
// eslint-disable-next-line quotes
|
||||
throw new Error(`Fragement should contain 'html'`);
|
||||
throw new Error("Fragement should contain 'html'");
|
||||
}
|
||||
}
|
||||
const $el = $(fragment.html.trim());
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if ($el.length === 0) {
|
||||
// eslint-disable-next-line quotes
|
||||
throw new Error(`Unable to build elements from fragment 'html'`);
|
||||
throw new Error("Unable to build elements from fragment 'html'");
|
||||
}
|
||||
}
|
||||
const fragmentId = $el.attr('data-fragment-id');
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (!fragmentId) {
|
||||
// eslint-disable-next-line quotes
|
||||
throw new Error(`Unable to extract fragment id from fragment 'html'`);
|
||||
throw new Error("Unable to extract fragment id from fragment 'html'");
|
||||
}
|
||||
}
|
||||
const $target = $(`[data-fragment-id="${fragmentId}"]`);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if ($target.length === 0) {
|
||||
// eslint-disable-next-line quotes
|
||||
throw new Error(`Unable to get target fragment from fragment id`);
|
||||
throw new Error('Unable to get target fragment from fragment id');
|
||||
}
|
||||
}
|
||||
$target.trigger('vjContentRemove');
|
||||
|
||||
Reference in new issue
Block a user