Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/rules/no-default-alt-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
* * "Screen Shot 2020-10-20 at 2 52 27 PM"
* * "Screenshot 2020-10-20 at 2 52 27 PM"
* * "Clean Shot 2020-10-20 @45x"
* * "Screencast from 23 02 2024 19 15 19]"
*/
const defaultScreenshotRegex =
"(?:screen|clean) ?shot \\d{4}-\\d{2}-\\d{2}[^'\"\\]]*";
"(?:screen|clean) ?(?:shot|cast) \\d{4}-\\d{2}-\\d{2}[^'\"\\]]*";

const imageRegex = "image";
const combinedRegex = `(${[defaultScreenshotRegex, imageRegex].join("|")})`;
Expand Down
2 changes: 2 additions & 0 deletions test/no-default-alt-text.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe("GH001: No Default Alt Text", () => {
test("markdown example", async () => {
const strings = [
"![Screen Shot 2022-06-26 at 7 41 30 PM](https://user-images.githubusercontent.com/abcdef.png)",
"![Screencast from 23 02 2024 19 15 19](https://user-images.githubusercontent.com/abcdef.png)",
"![ScreenShot 2022-06-26 at 7 41 30 PM](https://user-images.githubusercontent.com/abcdef.png)",
"![Screen shot 2022-06-26 at 7 41 30 PM](https://user-images.githubusercontent.com/abcdef.png)",
"![Screenshot 2022-06-26 at 7 41 30 PM](https://user-images.githubusercontent.com/abcdef.png)",
Expand All @@ -50,6 +51,7 @@ describe("GH001: No Default Alt Text", () => {
test("HTML example", async () => {
const strings = [
'<img alt="Screen Shot 2022-06-26 at 7 41 30 PM" src="https://user-images.githubusercontent.com/abcdef.png">',
'<img alt=" Screencast from 23 02 2024 19 15 19" src="https://user-images.githubusercontent.com/abcdef.png">',
'<img alt="ScreenShot 2022-06-26 at 7 41 30 PM" src="https://user-images.githubusercontent.com/abcdef.png">',
'<img alt="Screen shot 2022-06-26 at 7 41 30 PM" src="https://user-images.githubusercontent.com/abcdef.png">',
'<img alt="Screenshot 2022-06-26 at 7 41 30 PM" src="https://user-images.githubusercontent.com/abcdef.png">',
Expand Down