mirror of https://github.com/vladmandic/automatic
update js linting
parent
83c078b28e
commit
2ad029834d
|
|
@ -40,7 +40,7 @@
|
|||
"globals": {
|
||||
// asssets
|
||||
"panzoom": "readonly",
|
||||
//script.js
|
||||
// script.js
|
||||
"log": "readonly",
|
||||
"debug": "readonly",
|
||||
"gradioApp": "readonly",
|
||||
|
|
@ -57,7 +57,12 @@
|
|||
"uiElementInSight": "readonly",
|
||||
"getUICurrentTabContent": "readonly",
|
||||
"waitForFlag": "readonly",
|
||||
//ui.js
|
||||
"logFn": "readonly",
|
||||
// contextmenus.js
|
||||
"generateForever": "readonly",
|
||||
// contributors.js
|
||||
"showContributors": "readonly",
|
||||
// ui.js
|
||||
"opts": "writable",
|
||||
"sortUIElements": "readonly",
|
||||
"all_gallery_buttons": "readonly",
|
||||
|
|
@ -79,7 +84,7 @@
|
|||
"setTheme": "readonly",
|
||||
// settings.js
|
||||
"registerDragDrop": "readonly",
|
||||
//extraNetworks.js
|
||||
// extraNetworks.js
|
||||
"requestGet": "readonly",
|
||||
"getENActiveTab": "readonly",
|
||||
"quickApplyStyle": "readonly",
|
||||
|
|
|
|||
|
|
@ -23,6 +23,16 @@ function gradioApp() {
|
|||
return elem.shadowRoot ? elem.shadowRoot : elem;
|
||||
}
|
||||
|
||||
function logFn(func) {
|
||||
return async function () { // eslint-disable-line func-names
|
||||
const t0 = performance.now();
|
||||
const returnValue = func(...arguments);
|
||||
const t1 = performance.now();
|
||||
log(func.name, Math.round(t1 - t0) / 1000);
|
||||
return returnValue;
|
||||
};
|
||||
}
|
||||
|
||||
function getUICurrentTab() {
|
||||
return gradioApp().querySelector('#tabs button.selected');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,11 +16,12 @@
|
|||
"url": "git+https://github.com/vladmandic/automatic.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"esbuild": "^0.18.15",
|
||||
"eslint": "^8.44.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0"
|
||||
"esbuild": "^0.18.15"
|
||||
},
|
||||
"dependencies": {
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-airbnb-base": "^15.0.0",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"eslint-plugin-json": "^3.1.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue