Files
claude-hud/tui/eslint.config.js
Jarrod Watts efabc82b5b feat: Add ESLint, Prettier, and pre-commit hooks
Phase 3 Foundation:
- Add ESLint with TypeScript, React, React Hooks, and Prettier config
- Add Prettier with project-standard settings
- Set up Husky pre-commit hooks with lint-staged
- Fix all ESLint errors and warnings in codebase
- Format all files with Prettier
- Fix type errors in usage-reader.test.ts

All 133 tests passing, lint clean, builds successfully.

Note: GitHub Actions CI workflow saved locally but requires
manual push with workflow scope or direct upload to GitHub.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-02 23:17:31 +11:00

88 lines
2.3 KiB
JavaScript

import eslint from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsparser from '@typescript-eslint/parser';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import prettier from 'eslint-config-prettier';
export default [
eslint.configs.recommended,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tsparser,
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
globals: {
console: 'readonly',
process: 'readonly',
setTimeout: 'readonly',
setInterval: 'readonly',
clearTimeout: 'readonly',
clearInterval: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
module: 'readonly',
require: 'readonly',
exports: 'readonly',
Promise: 'readonly',
Map: 'readonly',
Set: 'readonly',
Date: 'readonly',
Math: 'readonly',
JSON: 'readonly',
Error: 'readonly',
URL: 'readonly',
},
},
plugins: {
'@typescript-eslint': tseslint,
react: react,
'react-hooks': reactHooks,
},
rules: {
// TypeScript
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'warn',
// React
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react/jsx-uses-react': 'off',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// General
'no-console': 'off',
'no-unused-vars': 'off', // Use TypeScript's version
'prefer-const': 'error',
'no-var': 'error',
eqeqeq: ['error', 'always'],
},
settings: {
react: {
version: 'detect',
},
},
},
{
files: ['**/*.test.ts', '**/*.test.tsx'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
ignores: ['dist/**', 'node_modules/**', '*.js'],
},
prettier,
];