eslint.config.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import js from '@eslint/js';
  2. export default [
  3. js.configs.recommended,
  4. {
  5. languageOptions: {
  6. ecmaVersion: 2022,
  7. sourceType: 'module',
  8. globals: {
  9. // Browser globals
  10. window: 'readonly',
  11. document: 'readonly',
  12. console: 'readonly',
  13. setTimeout: 'readonly',
  14. setInterval: 'readonly',
  15. clearTimeout: 'readonly',
  16. clearInterval: 'readonly',
  17. fetch: 'readonly',
  18. URL: 'readonly',
  19. Blob: 'readonly',
  20. navigator: 'readonly',
  21. location: 'readonly',
  22. localStorage: 'readonly',
  23. sessionStorage: 'readonly',
  24. Image: 'readonly',
  25. Node: 'readonly',
  26. DOMParser: 'readonly',
  27. Intl: 'readonly',
  28. // Chrome extension globals
  29. chrome: 'readonly',
  30. self: 'readonly',
  31. globalThis: 'readonly',
  32. importScripts: 'readonly',
  33. // Extension-specific globals
  34. $: 'readonly',
  35. jQuery: 'readonly',
  36. Vue: 'readonly',
  37. CodeMirror: 'readonly',
  38. BigNumber: 'readonly',
  39. BigInt: 'readonly',
  40. evalCore: 'readonly',
  41. toast: 'readonly',
  42. DarkModeMgr: 'readonly',
  43. Formatter: 'readonly',
  44. JsonABC: 'readonly',
  45. JsonEnDecode: 'readonly',
  46. JsonLint: 'readonly',
  47. Awesome: 'readonly',
  48. InstallTrigger: 'readonly',
  49. },
  50. },
  51. rules: {
  52. 'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
  53. 'no-undef': 'warn',
  54. 'no-empty': 'warn',
  55. 'no-constant-condition': 'warn',
  56. },
  57. },
  58. {
  59. ignores: [
  60. 'apps/static/vendor/**',
  61. 'node_modules/**',
  62. 'output/**',
  63. 'apps/json-format/json-bigint.js',
  64. 'test/**',
  65. ],
  66. },
  67. ];