// Lint rules, kept to the mistakes tests can't catch — chiefly a name that // doesn't exist, which only shows up when that line finally runs. const js = require('@eslint/js'); const globals = require('globals'); module.exports = [ { ignores: ['node_modules/**', 'uploads/**', 'thumbnails/**', 'glb/**', 'extracted/**', 'models/**', 'data/**', 'backups/**', 'tools/venv/**'] }, // The server: Node, CommonJS. { files: ['**/*.js'], languageOptions: { ecmaVersion: 2023, sourceType: 'commonjs', globals: { ...globals.node }, }, rules: { ...js.configs.recommended.rules, 'no-unused-vars': ['error', { argsIgnorePattern: '^_|^next$', caughtErrors: 'none' }], }, }, // The browser: plain scripts sharing globals across files, plus one module. { files: ['public/**/*.js'], languageOptions: { sourceType: 'script', globals: { ...globals.browser, ModelViewer: 'readonly', // viewer.js hangs it on window PRINTER_MODELS: 'readonly', // printer-art.js does the same }, }, }, { files: ['public/viewer.js'], languageOptions: { sourceType: 'module' }, }, // Tests. { files: ['test/**/*.js'], languageOptions: { globals: { ...globals.node } }, }, ];