Archon/eslint.config.mjs
Cole Medin ae346c2a67 feat: prepare for open-source migration to coleam00/Archon
- Replace all dynamous-community/remote-coding-agent references with coleam00/Archon
- Replace all ghcr.io/dynamous-community/remote-coding-agent with ghcr.io/coleam00/archon
- Change license from proprietary Dynamous to MIT
- Fix cd directory name in docs (remote-coding-agent → Archon)
- Remove hardcoded local paths from skills and docs
- Add Windows x64 binary to release pipeline (cross-compiled from Linux)
- Add --minify --bytecode flags to binary compilation
- Create PowerShell install script (scripts/install.ps1)
- Fix isBinaryBuild() detection for Bun 1.3.5+ (use import.meta.dir virtual FS check)
- Scaffold Astro Starlight docs site at website/ (Astro 6 + Starlight 0.38)
- Add deploy-docs.yml workflow for GitHub Pages
- Update test.yml branch triggers (develop → dev)
- Add install section with curl/PowerShell/Homebrew/Docker to README
- Add badges and archon.diy docs link to README
- Create SECURITY.md with vulnerability disclosure policy
- Update CONTRIBUTING.md for public audience
- Add website/ and eslint ignores for Astro-generated files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 10:47:22 -05:00

110 lines
3.9 KiB
JavaScript

import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import prettierConfig from 'eslint-config-prettier';
export default tseslint.config(
// Global ignores (applied to all configs)
{
ignores: [
'node_modules/**',
'packages/*/node_modules/**',
'packages/*/dist/**',
'dist/**',
'coverage/**',
'.agents/examples/**',
'website/**',
'workspace/**',
'worktrees/**',
'.claude/worktrees/**',
'.claude/skills/**',
'**/*.js',
'*.mjs',
'**/*.test.ts',
'*.d.ts', // Root-level declaration files (not in tsconfig project scope)
'**/*.generated.d.ts', // Auto-generated declaration files (e.g. openapi-typescript output)
'packages/web/vite.config.ts', // Vite config doesn't need type-checked linting
'packages/web/components.json',
'packages/web/src/components/ui/**', // shadcn/ui auto-generated components
'packages/web/src/lib/utils.ts', // shadcn/ui utility file
],
},
// Base configs
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
// Prettier integration
prettierConfig,
// Project-specific settings
{
files: ['packages/*/src/**/*.{ts,tsx}'],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
// === ENFORCED RULES (errors) ===
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
quotes: ['error', 'single', { avoidEscape: true }],
semi: ['error', 'always'],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'interface',
format: ['PascalCase'],
custom: { regex: '^I?[A-Z]', match: true },
},
{ selector: 'typeAlias', format: ['PascalCase'] },
{ selector: 'function', format: ['camelCase', 'PascalCase'] },
{ selector: 'variable', format: ['camelCase', 'UPPER_CASE'] },
],
'@typescript-eslint/no-non-null-assertion': 'error',
// === DISABLED RULES ===
// --- Template/expression rules ---
// Numbers/booleans in template literals are valid JS (auto-converted to string)
'@typescript-eslint/restrict-template-expressions': 'off',
// Mixed operands in + are often intentional (string concatenation)
'@typescript-eslint/restrict-plus-operands': 'off',
// --- Defensive coding patterns ---
// Switch defaults, null checks, and defensive guards are valuable
'@typescript-eslint/no-unnecessary-condition': 'off',
// Env var checks need || for truthy evaluation (empty string = missing)
'@typescript-eslint/prefer-nullish-coalescing': 'off',
// --- External SDK interop (types are often `any` or incomplete) ---
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
// Event handler patterns in SDKs often have promise mismatches
'@typescript-eslint/no-misused-promises': 'off',
'@typescript-eslint/no-floating-promises': 'off',
// --- Style preferences (not critical for type safety) ---
// Catch variable typing preference
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'off',
// Allow using deprecated APIs during migration periods
'@typescript-eslint/no-deprecated': 'off',
// Empty async functions valid for interface compliance
'@typescript-eslint/require-await': 'off',
// Constructor style preference
'@typescript-eslint/consistent-generic-constructors': 'off',
},
}
);