// ESLint 9 flat config. Scope is deliberately small: this project targets zero // client JavaScript (CLAUDE.md, AGENTS.md §7), so the only JS/TS here is build // configuration, site data, and the occasional island. Rules exist to catch // mistakes, not to impose style — Prettier owns formatting. // // `typescript-eslint` is here because .astro frontmatter IS TypeScript, so the // plugin cannot parse a single component without it. It runs unconfigured for // type-awareness on purpose: `astro check` already does the type checking, and // duplicating it here would be slower and would disagree at the edges. import js from '@eslint/js'; import globals from 'globals'; import tseslint from 'typescript-eslint'; import astro from 'eslint-plugin-astro'; export default [ { ignores: ['dist/**', 'node_modules/**', '.astro/**', 'docs/reference/**'] }, js.configs.recommended, ...tseslint.configs.recommended, ...astro.configs.recommended, { files: ['**/*.{js,mjs,ts}', '**/*.astro'], languageOptions: { ecmaVersion: 2023, sourceType: 'module', globals: { ...globals.browser, ...globals.node }, }, rules: { // A stray console.log in a static build is dead weight shipped to nobody. 'no-console': ['warn', { allow: ['warn', 'error'] }], eqeqeq: ['error', 'always'], 'prefer-const': 'error', '@typescript-eslint/no-unused-vars': [ 'error', { argsIgnorePattern: '^_' }, ], }, }, ];