Skip to content

Enforce kebab case filenames - #21

Merged
kzhou314 merged 2 commits into
mainfrom
enforce-kebab-case-filenames
Jun 5, 2026
Merged

Enforce kebab case filenames#21
kzhou314 merged 2 commits into
mainfrom
enforce-kebab-case-filenames

Conversation

@kzhou314

@kzhou314 kzhou314 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Fixes github/accessibility#10721

Enforce kebab-case convention for all .ts files under src and tests through manual rename and ESlint configuration.

Copilot AI review requested due to automatic review settings June 5, 2026 17:53

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.

✅ Ready to approve

The renames, import updates, and ESLint enforcement are internally consistent and the repository references appear fully updated to the new kebab-case filenames.

Note: this review does not count toward required approvals for merging.

Pull request overview

This PR enforces a kebab-case filename convention across the TypeScript code under src/ and tests/, updating imports to match renamed files and adding an ESLint rule to prevent regressions.

Changes:

  • Renamed rule/util files and updated rule/test imports to use kebab-case paths (and correct relative paths in unit tests).
  • Added eslint-plugin-check-file and configured ESLint to enforce kebab-case .ts filenames under src/** and tests/**.
  • Introduced/registered the missing-alt-text rule and added normalize-alt-text utility used by multiple rules.
File summaries
File Description
tests/unit/vague-alt-text.test.ts Updates imports to kebab-case rule filename and correct helpers path.
tests/unit/repeated-alt-text.test.ts Updates imports to kebab-case rule filename and correct helpers path.
tests/unit/missing-alt-text.test.ts Updates imports to kebab-case rule filename and correct helpers path.
src/utils/normalize-alt-text.ts Adds kebab-case utility module for alt-text normalization used by rules.
src/rules/vague-alt-text.ts Updates normalize utility import to kebab-case filename.
src/rules/repeated-alt-text.ts Updates normalize utility import to kebab-case filename.
src/rules/placeholder-alt-text.ts Updates normalize utility import to kebab-case filename.
src/rules/missing-alt-text.ts Adds kebab-case rule module for detecting missing/whitespace-only alt text.
src/rules/index.ts Updates rule imports to kebab-case filenames and ensures registry points at renamed modules.
package.json Adds eslint-plugin-check-file devDependency (supports filename convention enforcement).
package-lock.json Locks eslint-plugin-check-file and its transitive dependencies.
eslint.config.js Configures check-file/filename-naming-convention for src/**/*.ts and tests/**/*.ts.

Copilot's findings

  • Files reviewed: 9/12 changed files
  • Comments generated: 0

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kzhou314
kzhou314 requested a review from JoyceZhu June 5, 2026 18:10
@kzhou314
kzhou314 force-pushed the enforce-kebab-case-filenames branch from 6ed8f2e to 3f17dec Compare June 5, 2026 18:32
@JoyceZhu

JoyceZhu commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Just to explicitly check, you and @taarikashenafi discussed and agreed on kebab case?

@kzhou314

kzhou314 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Just to explicitly check, you and @taarikashenafi discussed and agreed on kebab case?

Yeah, Taarik and I agreed on this yesterday. I believe this follows the main scanner repo's file naming conventions (?)

@JoyceZhu JoyceZhu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Awesome you found another library which does this!

@kzhou314
kzhou314 merged commit 50574e5 into main Jun 5, 2026
8 checks passed
@kzhou314
kzhou314 deleted the enforce-kebab-case-filenames branch June 5, 2026 20:39
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