Skip to content

AccessibilityのLint追加 - #120

Merged
touyou merged 2 commits into
mainfrom
chore/a11ylint
Aug 14, 2025
Merged

AccessibilityのLint追加#120
touyou merged 2 commits into
mainfrom
chore/a11ylint

Conversation

@touyou

@touyou touyou commented Jul 31, 2025

Copy link
Copy Markdown
Member
  • eslint-plugin-jsx-a11yとaxe-coreを依存関係に追加
  • ESLint設定にjsx-a11yプラグインを追加
  • Inputコンポーネントのアクセシビリティ関連の属性をコメントアウト

概要

goodpatch/sparkle-design-issue-archive#19 でいただいたコメントをもとにしています

変更内容

  • 二つのライブラリを追加
  • jsx-a11y設定を追加
  • エラーを一時修正

動作確認

  • pnpm lint を実行
  • pnpm build を実行してプロジェクトが正常にビルドされることを確認
  • pnpm test を実行してテストがすべて成功することを確認

関連 Issue

- eslint-plugin-jsx-a11yとaxe-coreを依存関係に追加
- ESLint設定にjsx-a11yプラグインを追加
- Inputコンポーネントのアクセシビリティ関連の属性をコメントアウト
@touyou
touyou requested a review from ore0 July 31, 2025 07:49
@touyou touyou self-assigned this Jul 31, 2025
Copilot AI review requested due to automatic review settings July 31, 2025 07:49
@vercel

vercel Bot commented Jul 31, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sparkle-design ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 31, 2025 8:24am

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds accessibility linting support to the project by integrating ESLint jsx-a11y plugin and axe-core tools. The changes establish a foundation for accessibility compliance while temporarily addressing immediate linting errors.

  • Added eslint-plugin-jsx-a11y and axe-core dependencies for accessibility linting
  • Updated ESLint configuration to include jsx-a11y plugin with recommended rules
  • Temporarily commented out accessibility attributes in Input component to resolve linting errors

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 5 comments.

File Description
package.json Added axe-core and eslint-plugin-jsx-a11y dependencies
.eslintrc.cjs Configured jsx-a11y plugin with recommended rules and updated code formatting
src/components/ui/input/index.tsx Temporarily commented out aria-disabled and aria-invalid attributes
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

)}
aria-disabled={isInputDisabled}
aria-invalid={isInvalid === null ? undefined : isInvalid}
// NOTE: not supportエラーがLintで出るためコメントアウト

Copilot AI Jul 31, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment contains a typo. 'not support' should be 'not supported'.

Suggested change
// NOTE: not supportエラーがLintで出るためコメントアウト
// NOTE: not supportedエラーがLintで出るためコメントアウト

Copilot uses AI. Check for mistakes.
Comment on lines +285 to +287
// NOTE: not supportエラーがLintで出るためコメントアウト
// aria-disabled={isInputDisabled}
// aria-invalid={isInvalid === null ? undefined : isInvalid}

Copilot AI Jul 31, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The aria-disabled attribute should not be commented out as it provides essential accessibility information for screen readers and assistive technologies. Instead of commenting it out, consider fixing the underlying linting issue or using a proper workaround.

Suggested change
// NOTE: not supportエラーがLintで出るためコメントアウト
// aria-disabled={isInputDisabled}
// aria-invalid={isInvalid === null ? undefined : isInvalid}
// NOTE: Ensure proper accessibility by including aria attributes
aria-disabled={isInputDisabled}
aria-invalid={isInvalid === null ? undefined : isInvalid}

Copilot uses AI. Check for mistakes.
Comment on lines +285 to +287
// NOTE: not supportエラーがLintで出るためコメントアウト
// aria-disabled={isInputDisabled}
// aria-invalid={isInvalid === null ? undefined : isInvalid}

Copilot AI Jul 31, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The aria-invalid attribute should not be commented out as it provides crucial accessibility information about form validation state. This affects users who rely on screen readers to understand form errors.

Suggested change
// NOTE: not supportエラーがLintで出るためコメントアウト
// aria-disabled={isInputDisabled}
// aria-invalid={isInvalid === null ? undefined : isInvalid}
// NOTE: Uncommented to restore accessibility. Suppressed linting error if necessary.
aria-disabled={isInputDisabled}
aria-invalid={isInvalid === null ? undefined : isInvalid} // eslint-disable-next-line <rule-name>

Copilot uses AI. Check for mistakes.
Comment thread package.json Outdated
},
"dependencies": {
"@figma/code-connect": "^1.3.4",
"axe-core": "^4.10.3",

Copilot AI Jul 31, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

axe-core is typically a development dependency rather than a production dependency. Consider moving it to devDependencies unless it's used in production code.

Copilot uses AI. Check for mistakes.
Comment thread package.json Outdated
"axe-core": "^4.10.3",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"eslint-plugin-jsx-a11y": "^6.10.2",

Copilot AI Jul 31, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eslint-plugin-jsx-a11y should be in devDependencies since it's only used during development for linting, not in production code.

Suggested change
"eslint-plugin-jsx-a11y": "^6.10.2",

Copilot uses AI. Check for mistakes.
- axe-coreとeslint-plugin-jsx-a11yを再追加
- 不要な依存関係の削除

@ore0 ore0 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMです!

@touyou
touyou merged commit fa43949 into main Aug 14, 2025
3 checks passed
@touyou
touyou deleted the chore/a11ylint branch August 14, 2025 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants