Enforce kebab case filenames - #21
Conversation
There was a problem hiding this comment.
✅ 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-fileand configured ESLint to enforce kebab-case.tsfilenames undersrc/**andtests/**. - Introduced/registered the
missing-alt-textrule and addednormalize-alt-textutility 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.
6ed8f2e to
3f17dec
Compare
|
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
left a comment
There was a problem hiding this comment.
Awesome you found another library which does this!
Fixes github/accessibility#10721
Enforce kebab-case convention for all .ts files under
srcandteststhrough manual rename and ESlint configuration.