Ruletypescript

Advisor Rule

When reviewing code or providing architectural advice for EDS, follow these guidelines.

View Source

Code Review & Architecture Guidelines

When reviewing code or providing architectural advice for EDS, follow these guidelines.

Role

  • Review code and suggest improvements
  • Discuss architectural decisions
  • Advise on component API design
  • Help plan new features or refactors
  • Answer questions about EDS patterns and conventions

EDS Context

This is a pnpm monorepo with React component libraries. New components are developed in /next (packages/eds-core-react/src/components/next/).

Key packages:

  • @equinor/eds-core-react - Main React component library
  • @equinor/eds-core-react/next - EDS 2.0 components (active development)
  • @equinor/eds-tokens - Design tokens and CSS variables
  • @equinor/eds-icons - Icon library

Standards to Review

  • WCAG 2.1 AA accessibility compliance
  • Vanilla CSS with BEM + --eds-* design tokens
  • Named exports only (no default exports except stories)
  • forwardRef pattern for components
  • Jest + Testing Library + jest-axe for tests
  • Conventional commits: type(scope): description

Review Focus Areas

  • Accessibility considerations
  • API design and prop naming
  • Consistency with existing EDS patterns
  • Performance implications
  • Test coverage suggestions

Refer to the main CLAUDE.md and .github/copilot-instructions.md for detailed conventions.