.eslintrc.js 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* global module */
  2. module.exports = {
  3. env: {
  4. browser: true,
  5. es2021: true,
  6. },
  7. extends: "eslint:recommended",
  8. parserOptions: {
  9. ecmaVersion: "latest",
  10. },
  11. rules: {
  12. "arrow-spacing": "error",
  13. "block-spacing": "error",
  14. "brace-style": "error",
  15. "comma-dangle": ["error", "only-multiline"],
  16. "comma-spacing": "error",
  17. "comma-style": ["error", "last"],
  18. "curly": ["error", "multi-line", "consistent"],
  19. "eol-last": "error",
  20. "func-call-spacing": "error",
  21. "function-call-argument-newline": ["error", "consistent"],
  22. "function-paren-newline": ["error", "consistent"],
  23. "indent": ["error", 4],
  24. "key-spacing": "error",
  25. "keyword-spacing": "error",
  26. "linebreak-style": ["error", "unix"],
  27. "no-extra-semi": "error",
  28. "no-mixed-spaces-and-tabs": "error",
  29. "no-multi-spaces": "error",
  30. "no-redeclare": ["error", {builtinGlobals: false}],
  31. "no-trailing-spaces": "error",
  32. "no-unused-vars": "off",
  33. "no-whitespace-before-property": "error",
  34. "object-curly-newline": ["error", {consistent: true, multiline: true}],
  35. "object-curly-spacing": ["error", "never"],
  36. "operator-linebreak": ["error", "after"],
  37. "quote-props": ["error", "consistent-as-needed"],
  38. "semi": ["error", "always"],
  39. "semi-spacing": "error",
  40. "semi-style": ["error", "last"],
  41. "space-before-blocks": "error",
  42. "space-before-function-paren": ["error", "never"],
  43. "space-in-parens": ["error", "never"],
  44. "space-infix-ops": "error",
  45. "space-unary-ops": "error",
  46. "switch-colon-spacing": "error",
  47. "template-curly-spacing": ["error", "never"],
  48. "unicode-bom": "error",
  49. },
  50. globals: {
  51. //script.js
  52. gradioApp: "readonly",
  53. executeCallbacks: "readonly",
  54. onAfterUiUpdate: "readonly",
  55. onOptionsChanged: "readonly",
  56. onUiLoaded: "readonly",
  57. onUiUpdate: "readonly",
  58. uiCurrentTab: "writable",
  59. uiElementInSight: "readonly",
  60. uiElementIsVisible: "readonly",
  61. //ui.js
  62. opts: "writable",
  63. all_gallery_buttons: "readonly",
  64. selected_gallery_button: "readonly",
  65. selected_gallery_index: "readonly",
  66. switch_to_txt2img: "readonly",
  67. switch_to_img2img_tab: "readonly",
  68. switch_to_img2img: "readonly",
  69. switch_to_sketch: "readonly",
  70. switch_to_inpaint: "readonly",
  71. switch_to_inpaint_sketch: "readonly",
  72. switch_to_extras: "readonly",
  73. get_tab_index: "readonly",
  74. create_submit_args: "readonly",
  75. restart_reload: "readonly",
  76. updateInput: "readonly",
  77. //extraNetworks.js
  78. requestGet: "readonly",
  79. popup: "readonly",
  80. // from python
  81. localization: "readonly",
  82. // progrssbar.js
  83. randomId: "readonly",
  84. requestProgress: "readonly",
  85. // imageviewer.js
  86. modalPrevImage: "readonly",
  87. modalNextImage: "readonly",
  88. // token-counters.js
  89. setupTokenCounters: "readonly",
  90. }
  91. };