managarten/packages/eslint-config/typescript.js
Till JS 22a73943e1 chore: complete ManaCore → Mana rename (docs, go modules, plists, images)
Final cleanup of references missed in previous rename commits:

- Dockerfiles: PUBLIC_MANA_CORE_AUTH_URL → PUBLIC_MANA_AUTH_URL
- Go modules: github.com/manacore/* → github.com/mana/* (7 go.mod files)
- launchd plists: com.manacore.* → com.mana.* (14 files renamed + content)
- Image assets: *_Manacore_AI_Credits* → *_Mana_AI_Credits* (11 files)
- .env.example files: ManaCore brand strings → Mana
- .prettierignore: stale apps/manacore/* paths → apps/mana/*
- Markdown docs (CLAUDE.md, /docs/*): mana-core-auth → mana-auth, etc.

Excluded from rename: .claude/, devlog/, manascore/ (historical content),
client testimonials, blueprints, npm package refs (@mana-core/*).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:26:10 +02:00

89 lines
2.7 KiB
JavaScript

/**
* TypeScript ESLint configuration
*
* Provides type-aware linting rules for TypeScript projects.
* Uses projectService for automatic tsconfig detection in monorepos.
*
* Strictness balance:
* - ERROR: Unused variables, unsafe operations
* - WARN: Explicit any (allow during migration), return types
* - OFF: Rules that conflict with TypeScript's own checks
*/
import tseslint from 'typescript-eslint';
/** @type {import('eslint').Linter.Config[]} */
export const typescriptConfig = [
...tseslint.configs.recommended,
{
files: ['**/*.ts', '**/*.tsx', '**/*.mts', '**/*.cts'],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
projectService: true,
},
},
plugins: {
'@typescript-eslint': tseslint.plugin,
},
rules: {
// ============================================
// ERRORS - Type safety violations
// ============================================
// Unused code must be removed
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
// Enforce proper typing
'@typescript-eslint/no-non-null-assertion': 'warn',
// ============================================
// WARNINGS - Best practices, fix when convenient
// ============================================
// Allow any during migration, but flag it
'@typescript-eslint/no-explicit-any': 'warn',
// Encourage type annotations on exports
'@typescript-eslint/explicit-function-return-type': 'off', // Too verbose
'@typescript-eslint/explicit-module-boundary-types': 'off', // Too verbose
// Prefer modern patterns
'@typescript-eslint/prefer-as-const': 'warn',
'@typescript-eslint/no-inferrable-types': 'warn',
// Disabled: requires type-aware linting which conflicts with svelte-eslint-parser
// for .svelte.ts files. Can be re-enabled with parser-specific scoping.
'@typescript-eslint/consistent-type-imports': 'off',
// ============================================
// OFF - Too strict or handled elsewhere
// ============================================
// Allow empty functions (common in interfaces/defaults)
'@typescript-eslint/no-empty-function': 'off',
// Allow require() for dynamic imports
'@typescript-eslint/no-require-imports': 'off',
// Allow namespace for declaration merging
'@typescript-eslint/no-namespace': 'off',
// Base rule must be off when using TS version
'no-unused-vars': 'off',
// Allow this aliasing in some patterns (e.g., closures)
'@typescript-eslint/no-this-alias': 'warn',
},
},
];
export default typescriptConfig;