スキル一覧に戻る
allenlin90

frontend-code-quality

by allenlin90

1🍴 0📅 2026年1月24日
GitHubで見るManusで実行

SKILL.md


name: frontend-code-quality description: Provides code quality standards for frontend applications. This skill should be used when configuring linting rules, organizing file structures, or ensuring consistency across React applications.

Frontend Code Quality

This skill defines the quality standards specific to frontend applications.

Linting & Formatting

We use ESLint 9 with a shared configuration (@eridu/eslint-config).

  • Command: pnpm lint (runs eslint . --fix)
  • Rules:
    • No any types.
    • React Hooks rules enforced (react-hooks/rules-of-hooks, react-hooks/exhaustive-deps).
    • Standard imports sorting.

Testing

We use Vitest for unit and component testing.

  • Command: pnpm test
  • Environment: happy-dom
  • Testing Library: @testing-library/react for component interactions.

Component Test Example

import { render, screen } from '@testing-library/react';
import { Button } from '@eridu/ui/components/button';

test('renders button', () => {
  render(<Button>Click me</Button>);
  expect(screen.getByRole('button', { name: /click me/i })).toBeInTheDocument();
});

File Structure & Naming

  • Components: PascalCase (e.g., UserProfile.tsx).
  • Hooks: camelCase with use prefix (e.g., useAuth.ts).
  • Utilities: camelCase (e.g., formatDate.ts).
  • Routes: File-based routing conventions of TanStack Router (e.g., posts/$postId.tsx).

Best Practices

  1. Strict Props: Define specific interfaces for props, avoid any or broad object types.
  2. Server State separation: Use TanStack Query for server data; use React.useState/useReducer only for local UI state.
  3. Composition over Inheritance: Build complex UIs by composing small, focused components.

Checklist

  • pnpm lint passes without errors.
  • pnpm test passes.
  • Component names match their filenames.
  • Complex logic extracted to custom hooks.

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です