|
| 1 | +export default [ |
| 2 | + { |
| 3 | + ignores: [ |
| 4 | + '**/node_modules/**', |
| 5 | + '**/dist/**', |
| 6 | + '**/build/**', |
| 7 | + '**/.pytest_cache/**', |
| 8 | + '**/__pycache__/**', |
| 9 | + '**/coverage/**', |
| 10 | + ], |
| 11 | + }, |
| 12 | + { |
| 13 | + files: ['**/*.js'], |
| 14 | + languageOptions: { |
| 15 | + ecmaVersion: 2022, |
| 16 | + sourceType: 'module', |
| 17 | + globals: { |
| 18 | + // Browser globals |
| 19 | + window: 'readonly', |
| 20 | + document: 'readonly', |
| 21 | + console: 'readonly', |
| 22 | + localStorage: 'readonly', |
| 23 | + sessionStorage: 'readonly', |
| 24 | + fetch: 'readonly', |
| 25 | + FormData: 'readonly', |
| 26 | + URLSearchParams: 'readonly', |
| 27 | + URL: 'readonly', |
| 28 | + setTimeout: 'readonly', |
| 29 | + clearTimeout: 'readonly', |
| 30 | + setInterval: 'readonly', |
| 31 | + clearInterval: 'readonly', |
| 32 | + alert: 'readonly', |
| 33 | + confirm: 'readonly', |
| 34 | + prompt: 'readonly', |
| 35 | + CustomEvent: 'readonly', |
| 36 | + Event: 'readonly', |
| 37 | + MouseEvent: 'readonly', |
| 38 | + KeyboardEvent: 'readonly', |
| 39 | + TouchEvent: 'readonly', |
| 40 | + ResizeObserver: 'readonly', |
| 41 | + IntersectionObserver: 'readonly', |
| 42 | + MutationObserver: 'readonly', |
| 43 | + HTMLElement: 'readonly', |
| 44 | + Element: 'readonly', |
| 45 | + Node: 'readonly', |
| 46 | + NodeList: 'readonly', |
| 47 | + Blob: 'readonly', |
| 48 | + File: 'readonly', |
| 49 | + FileReader: 'readonly', |
| 50 | + Image: 'readonly', |
| 51 | + navigator: 'readonly', |
| 52 | + performance: 'readonly', |
| 53 | + requestAnimationFrame: 'readonly', |
| 54 | + getComputedStyle: 'readonly', |
| 55 | + // Plotly global (used in umap.js) |
| 56 | + Plotly: 'readonly', |
| 57 | + // Swiper global (used in swiper.js) |
| 58 | + Swiper: 'readonly', |
| 59 | + }, |
| 60 | + }, |
| 61 | + rules: { |
| 62 | + // Possible errors |
| 63 | + 'no-console': 'off', |
| 64 | + 'no-debugger': 'warn', |
| 65 | + 'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], |
| 66 | + 'no-undef': 'error', |
| 67 | + |
| 68 | + // Best practices |
| 69 | + 'eqeqeq': ['error', 'always'], |
| 70 | + 'curly': ['error', 'all'], |
| 71 | + 'no-eval': 'error', |
| 72 | + 'no-implied-eval': 'error', |
| 73 | + 'no-with': 'error', |
| 74 | + 'no-new-func': 'error', |
| 75 | + |
| 76 | + // ES6+ |
| 77 | + 'prefer-const': 'warn', |
| 78 | + 'no-var': 'warn', |
| 79 | + 'prefer-arrow-callback': 'warn', |
| 80 | + 'arrow-spacing': 'error', |
| 81 | + |
| 82 | + // Style (mostly handled by Prettier, but some logical style rules) |
| 83 | + // Note: quotes handled by Prettier, semi retained for logical consistency |
| 84 | + 'semi': ['error', 'always'], |
| 85 | + }, |
| 86 | + }, |
| 87 | + { |
| 88 | + files: ['tests/**/*.js', '**/*.test.js'], |
| 89 | + languageOptions: { |
| 90 | + globals: { |
| 91 | + // Jest globals |
| 92 | + describe: 'readonly', |
| 93 | + it: 'readonly', |
| 94 | + test: 'readonly', |
| 95 | + expect: 'readonly', |
| 96 | + beforeEach: 'readonly', |
| 97 | + afterEach: 'readonly', |
| 98 | + beforeAll: 'readonly', |
| 99 | + afterAll: 'readonly', |
| 100 | + jest: 'readonly', |
| 101 | + global: 'readonly', |
| 102 | + }, |
| 103 | + }, |
| 104 | + }, |
| 105 | +]; |
0 commit comments