eslint.config.cjs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. const eslintConfigPrettier = require("eslint-config-prettier");
  2. const globals = require("globals");
  3. const js = require("@eslint/js");
  4. module.exports = [
  5. // Global ignores
  6. {
  7. ignores: [
  8. // Only scan Jenkins source areas, not arbitrary top-level work directories
  9. "*/**",
  10. "!.github/**",
  11. "!.idea/**",
  12. "!.mvn/**",
  13. "!bom/**",
  14. "!cli/**",
  15. "!core/**",
  16. "!coverage/**",
  17. "!docs/**",
  18. "!src/**",
  19. "!test/**",
  20. "!war/**",
  21. "!websocket/**",
  22. "**/target/",
  23. "**/work/",
  24. // Node
  25. "**/node/",
  26. // Generated JavaScript Bundles
  27. "**/jsbundles/",
  28. // External scripts
  29. ".pnp.cjs",
  30. ".pnp.loader.mjs",
  31. "src/main/js/plugin-setup-wizard/bootstrap-detached.js",
  32. ],
  33. },
  34. {
  35. languageOptions: {
  36. ecmaVersion: 2022,
  37. sourceType: "module",
  38. globals: {
  39. ...globals.browser,
  40. applyTooltip: "readonly",
  41. AutoScroller: "readonly",
  42. Behaviour: "readonly",
  43. breadcrumbs: "readonly",
  44. buildFormTree: "readonly",
  45. CodeMirror: "readonly",
  46. ComboBox: "readonly",
  47. COMBOBOX_VERSION: "writeable",
  48. crumb: "readonly",
  49. dialog: "readonly",
  50. ensureVisible: "readonly",
  51. escapeHTML: "readonly",
  52. findAncestor: "readonly",
  53. findAncestorClass: "readonly",
  54. findElementsBySelector: "readonly",
  55. findFormParent: "readonly",
  56. fireEvent: "readonly",
  57. Form: "readonly",
  58. FormChecker: "readonly",
  59. getElementOverflowParams: "readonly",
  60. hoverNotification: "readonly",
  61. iota: "writeable",
  62. isInsideRemovable: "readonly",
  63. isPageVisible: "readonly",
  64. isRunAsTest: "readonly",
  65. layoutUpdateCallback: "readonly",
  66. loadScript: "readonly",
  67. makeButton: "readonly",
  68. notificationBar: "readonly",
  69. object: "readonly",
  70. objectToUrlFormEncoded: "readonly",
  71. onSetupWizardInitialized: "readonly",
  72. qs: "readonly",
  73. refillOnChange: "readonly",
  74. refreshPart: "readonly",
  75. registerSortableDragDrop: "readonly",
  76. renderOnDemand: "readonly",
  77. rootURL: "readonly",
  78. safeValidateButton: "readonly",
  79. setupWizardExtensions: "readonly",
  80. SharedArrayBuffer: "readonly",
  81. shortenName: "readonly",
  82. Sortable: "readonly",
  83. toQueryString: "readonly",
  84. TryEach: "readonly",
  85. ts_refresh: "readonly",
  86. updateOptionalBlock: "readonly",
  87. Utilities: "readonly",
  88. UTILITIES_VERSION: "writeable",
  89. YAHOO: "readonly",
  90. updateValidationArea: "readonly",
  91. },
  92. },
  93. },
  94. // Uses eslint default ruleset
  95. js.configs.recommended,
  96. eslintConfigPrettier,
  97. {
  98. rules: {
  99. curly: "error",
  100. },
  101. },
  102. {
  103. files: [
  104. "eslint.config.cjs",
  105. "postcss.config.js",
  106. "webpack.config.js",
  107. ".stylelintrc.js",
  108. ],
  109. languageOptions: {
  110. globals: {
  111. ...globals.node,
  112. },
  113. },
  114. },
  115. ];