2023-05-19 17:46:33 +08:00
|
|
|
/* global module */
|
2023-05-17 18:23:01 +08:00
|
|
|
module.exports = {
|
|
|
|
env: {
|
|
|
|
browser: true,
|
|
|
|
es2021: true,
|
|
|
|
},
|
2023-05-18 14:58:49 +08:00
|
|
|
extends: "eslint:recommended",
|
2023-05-17 18:23:01 +08:00
|
|
|
parserOptions: {
|
|
|
|
ecmaVersion: "latest",
|
|
|
|
},
|
|
|
|
rules: {
|
|
|
|
"arrow-spacing": "error",
|
|
|
|
"block-spacing": "error",
|
|
|
|
"brace-style": "error",
|
|
|
|
"comma-dangle": ["error", "only-multiline"],
|
|
|
|
"comma-spacing": "error",
|
|
|
|
"comma-style": ["error", "last"],
|
|
|
|
"curly": ["error", "multi-line", "consistent"],
|
|
|
|
"eol-last": "error",
|
|
|
|
"func-call-spacing": "error",
|
|
|
|
"function-call-argument-newline": ["error", "consistent"],
|
|
|
|
"function-paren-newline": ["error", "consistent"],
|
|
|
|
"indent": ["error", 4],
|
|
|
|
"key-spacing": "error",
|
|
|
|
"keyword-spacing": "error",
|
|
|
|
"linebreak-style": ["error", "unix"],
|
|
|
|
"no-extra-semi": "error",
|
|
|
|
"no-mixed-spaces-and-tabs": "error",
|
2023-05-19 17:42:01 +08:00
|
|
|
"no-multi-spaces": "error",
|
2023-05-19 17:55:06 +08:00
|
|
|
"no-redeclare": ["error", {builtinGlobals: false}],
|
2023-05-17 18:23:01 +08:00
|
|
|
"no-trailing-spaces": "error",
|
2023-05-19 17:42:01 +08:00
|
|
|
"no-unused-vars": "off",
|
2023-05-17 18:23:01 +08:00
|
|
|
"no-whitespace-before-property": "error",
|
|
|
|
"object-curly-newline": ["error", {consistent: true, multiline: true}],
|
2023-05-19 17:42:01 +08:00
|
|
|
"object-curly-spacing": ["error", "never"],
|
|
|
|
"operator-linebreak": ["error", "after"],
|
2023-05-17 18:23:01 +08:00
|
|
|
"quote-props": ["error", "consistent-as-needed"],
|
|
|
|
"semi": ["error", "always"],
|
|
|
|
"semi-spacing": "error",
|
|
|
|
"semi-style": ["error", "last"],
|
|
|
|
"space-before-blocks": "error",
|
|
|
|
"space-before-function-paren": ["error", "never"],
|
|
|
|
"space-in-parens": ["error", "never"],
|
|
|
|
"space-infix-ops": "error",
|
|
|
|
"space-unary-ops": "error",
|
|
|
|
"switch-colon-spacing": "error",
|
|
|
|
"template-curly-spacing": ["error", "never"],
|
|
|
|
"unicode-bom": "error",
|
|
|
|
},
|
2023-05-18 14:58:49 +08:00
|
|
|
globals: {
|
|
|
|
//script.js
|
2023-05-19 17:50:47 +08:00
|
|
|
gradioApp: "readonly",
|
2023-05-25 14:05:06 +08:00
|
|
|
executeCallbacks: "readonly",
|
|
|
|
onAfterUiUpdate: "readonly",
|
|
|
|
onOptionsChanged: "readonly",
|
2023-05-19 17:50:47 +08:00
|
|
|
onUiLoaded: "readonly",
|
|
|
|
onUiUpdate: "readonly",
|
2023-05-18 14:58:49 +08:00
|
|
|
uiCurrentTab: "writable",
|
2023-05-19 17:50:47 +08:00
|
|
|
uiElementInSight: "readonly",
|
2023-05-25 14:05:06 +08:00
|
|
|
uiElementIsVisible: "readonly",
|
2023-05-18 14:58:49 +08:00
|
|
|
//ui.js
|
|
|
|
opts: "writable",
|
2023-05-19 17:50:47 +08:00
|
|
|
all_gallery_buttons: "readonly",
|
|
|
|
selected_gallery_button: "readonly",
|
|
|
|
selected_gallery_index: "readonly",
|
|
|
|
switch_to_txt2img: "readonly",
|
|
|
|
switch_to_img2img_tab: "readonly",
|
|
|
|
switch_to_img2img: "readonly",
|
|
|
|
switch_to_sketch: "readonly",
|
|
|
|
switch_to_inpaint: "readonly",
|
|
|
|
switch_to_inpaint_sketch: "readonly",
|
|
|
|
switch_to_extras: "readonly",
|
|
|
|
get_tab_index: "readonly",
|
|
|
|
create_submit_args: "readonly",
|
|
|
|
restart_reload: "readonly",
|
|
|
|
updateInput: "readonly",
|
2023-10-01 15:15:23 +08:00
|
|
|
onEdit: "readonly",
|
2023-05-18 14:58:49 +08:00
|
|
|
//extraNetworks.js
|
2023-05-19 17:50:47 +08:00
|
|
|
requestGet: "readonly",
|
|
|
|
popup: "readonly",
|
2023-05-18 14:58:49 +08:00
|
|
|
// from python
|
2023-05-19 17:50:47 +08:00
|
|
|
localization: "readonly",
|
2023-05-18 14:58:49 +08:00
|
|
|
// progrssbar.js
|
2023-05-19 17:50:47 +08:00
|
|
|
randomId: "readonly",
|
|
|
|
requestProgress: "readonly",
|
2023-05-18 14:58:49 +08:00
|
|
|
// imageviewer.js
|
2023-05-19 17:50:47 +08:00
|
|
|
modalPrevImage: "readonly",
|
|
|
|
modalNextImage: "readonly",
|
2023-08-05 13:48:03 +08:00
|
|
|
// localStorage.js
|
|
|
|
localSet: "readonly",
|
|
|
|
localGet: "readonly",
|
2023-08-21 13:48:22 +08:00
|
|
|
localRemove: "readonly",
|
|
|
|
// resizeHandle.js
|
|
|
|
setupResizeHandle: "writable"
|
2023-05-18 14:58:49 +08:00
|
|
|
}
|
2023-05-17 18:23:01 +08:00
|
|
|
};
|