2026-11-19 01:41:27 +01:00
|
|
|
// ESLint (flat config). `npm run lint`. Catches real bugs (undefined names, unused code, typos) - no style rules.
|
|
|
|
|
'use strict';
|
|
|
|
|
const js = require('@eslint/js');
|
|
|
|
|
const globals = require('globals');
|
|
|
|
|
|
|
|
|
|
// shared across the classic <script> files of the game (no modules, see CLAUDE.md)
|
|
|
|
|
const gameGlobals = { RC: 'writable', Kit: 'writable', THREE: 'readonly', KIT_ASSETS: 'readonly', module: 'readonly', require: 'readonly' };
|
|
|
|
|
|
|
|
|
|
module.exports = [
|
|
|
|
|
{
|
|
|
|
|
ignores: ['node_modules/**', 'server/node_modules/**', 'release/**', 'game/vendor/**', 'game/kit/**',
|
2026-11-19 09:47:22 +01:00
|
|
|
'launcher/**', 'sprite-generator/**', 'tools/shots/**', 'admin/**', 'test-results/**', 'playwright-report/**'],
|
2026-11-19 01:41:27 +01:00
|
|
|
},
|
|
|
|
|
js.configs.recommended,
|
|
|
|
|
{
|
|
|
|
|
rules: {
|
|
|
|
|
'no-unused-vars': ['warn', { args: 'none', caughtErrors: 'none' }],
|
|
|
|
|
'no-empty': ['error', { allowEmptyCatch: true }],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-11-19 02:17:54 +01:00
|
|
|
files: ['game/**/*.js'],
|
2026-11-19 01:41:27 +01:00
|
|
|
languageOptions: { sourceType: 'script', globals: { ...globals.browser, ...gameGlobals } },
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-11-19 09:47:22 +01:00
|
|
|
files: ['server/**/*.js', 'tests/**/*.js', 'tools/**/*.js', 'eslint.config.js', 'playwright.config.js'],
|
2026-11-19 01:41:27 +01:00
|
|
|
languageOptions: { sourceType: 'commonjs', globals: { ...globals.node } },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
files: ['**/*.mjs'],
|
|
|
|
|
languageOptions: { sourceType: 'module', globals: { ...globals.node } },
|
|
|
|
|
},
|
|
|
|
|
];
|