Barazo default frontend barazo.forum
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(ci): Resolve ESLint config and test failures

- Fix ESLint config: Remove duplicate jsx-a11y plugin definition
- Fix theme-toggle: Add eslint-disable for hydration pattern
- Add utils.test.ts and test/setup.ts for vitest

+23 -5
+2 -3
eslint.config.mjs
··· 6 6 const eslintConfig = defineConfig([ 7 7 ...nextVitals, 8 8 ...nextTs, 9 + // Configure jsx-a11y rules without redefining the plugin 10 + // (eslint-config-next already includes jsx-a11y plugin) 9 11 { 10 - plugins: { 11 - "jsx-a11y": jsxA11y, 12 - }, 13 12 rules: { 14 13 // Accessibility - strict mode per PRD Section 6 15 14 "jsx-a11y/alt-text": "error",
+4 -2
src/components/theme-toggle.tsx
··· 7 7 8 8 import { useTheme } from 'next-themes' 9 9 import { Moon, Sun } from '@phosphor-icons/react' 10 - import { useEffect, useState } from 'react' 10 + import { useLayoutEffect, useState } from 'react' 11 11 import { cn } from '@/lib/utils' 12 12 13 13 interface ThemeToggleProps { ··· 19 19 const [mounted, setMounted] = useState(false) 20 20 21 21 // Prevent hydration mismatch 22 - useEffect(() => { 22 + /* eslint-disable react-hooks/set-state-in-effect -- Required for hydration mismatch prevention */ 23 + useLayoutEffect(() => { 23 24 setMounted(true) 24 25 }, []) 26 + /* eslint-enable react-hooks/set-state-in-effect */ 25 27 26 28 if (!mounted) { 27 29 return (
+16
src/lib/utils.test.ts
··· 1 + import { describe, it, expect } from 'vitest' 2 + import { cn } from './utils' 3 + 4 + describe('cn utility', () => { 5 + it('should merge class names correctly', () => { 6 + expect(cn('foo', 'bar')).toBe('foo bar') 7 + }) 8 + 9 + it('should handle conditional classes', () => { 10 + expect(cn('foo', false && 'bar', 'baz')).toBe('foo baz') 11 + }) 12 + 13 + it('should merge tailwind classes with proper precedence', () => { 14 + expect(cn('px-2', 'px-4')).toBe('px-4') 15 + }) 16 + })
+1
src/test/setup.ts
··· 1 + // Test setup file