Socket
Socket
Sign inDemoInstall

@double-great/alt-text

Package Overview
Dependencies
3
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.0-beta.4 to 1.2.0-beta.5

22

dist/clues.js
export const clues = {
notOnlySpace: {
heading: "Empty alt text",
docs: "https://git.io/Jvqim",
docs: "https://tinyurl.com/y2o7uctu",
suggestion: () => `Alt text should not be a single space`,

@@ -13,3 +13,3 @@ rationale: 'If you use null (empty) alt text (`alt=""`) to hide decorative images, make sure that there is no space character in between the quotes. **If a space character is present, the image may not be effectively hidden from assistive technologies.** For instance, some screen readers will still announce the presence of an image if a space character is put between the quotes.',

heading: "Character length",
docs: "https://git.io/Jvfxm",
docs: "https://tinyurl.com/y2f7rhao",
suggestion: (value) => `Alt text length should be less than 125 characters${value ? `, it is currently ${value} characters` : ""}`,

@@ -26,3 +26,3 @@ rationale: "Alt text should be less than 125 characters in length. The JAWS screen reader reads alt text in 125 character chunks. Any information about the image, such as copyright information, image source or extra information should be placed in the caption text below the image.",

heading: "Image is link",
docs: "https://git.io/JvfNj",
docs: "https://tinyurl.com/yxhq2k5w",
suggestion: () => `Images inside a link tag require alt text that describes the purpose of the link`,

@@ -36,3 +36,3 @@ rationale: "Images inside a link tag require alt text that describes the purpose of the link.",

heading: "End with punctuation",
docs: "https://git.io/JJk55",
docs: "https://tinyurl.com/y5krn3ny",
suggestion: () => `Alt text should end with punctuation`,

@@ -47,3 +47,3 @@ rationale: "End the alt text with a period, exclamation point, or question mark. This will make screen readers pause a bit after the last word in the alt text, which creates a more pleasant reading experience for the user.",

heading: "Missing alt attribute",
docs: "https://git.io/JvfNh",
docs: "https://tinyurl.com/yybc6bsy",
suggestion: () => `Missing "alt" attribute`,

@@ -57,3 +57,3 @@ rationale: "All images must have alternate text to convey their purpose and meaning to screen reader users.",

heading: "Alt text contains unhelpful words",
docs: "https://git.io/JvqAM",
docs: "https://tinyurl.com/y3v3jgux",
fn: (item, alt) => alt.includes(item),

@@ -82,3 +82,3 @@ suggestion: (value) => `Alt text should not contain "${value}"`,

heading: "Alt text is unhelpful",
docs: "https://git.io/JvqAK",
docs: "https://tinyurl.com/yxwc2hof",
fn: (item, alt) => item == alt.trim(),

@@ -124,3 +124,3 @@ suggestion: (value) => `Alt text should not be "${value}"`,

heading: "Alt text should not end with",
docs: "https://git.io/JvfAf",
docs: "https://tinyurl.com/yy2q8bbb",
fn: (item, alt) => alt.endsWith(item),

@@ -145,3 +145,3 @@ suggestion: (value) => `Alt text should not end with "${value}"`,

heading: "Alt text should not start with",
docs: "https://git.io/JvfAv",
docs: "https://tinyurl.com/y5y98ygu",
fn: (item, alt) => alt.startsWith(item),

@@ -170,3 +170,3 @@ suggestion: (value) => `Alt text should not start with "${value}"`,

heading: "Image is decorative",
docs: "https://git.io/Jvqx8",
docs: "https://tinyurl.com/yxnvejgv",
suggestion: () => `Empty alt text should only be used for decorative images`,

@@ -180,3 +180,3 @@ rationale: `Provide "null" \`alt\` attributes (using \`alt=""\`) for images which do not provide information or do not require alternative text because the image is described in the page content. Some developers will mistakenly leave off the alt attribute altogether on images which they deem do not need alternatives. This is not helpful to assistive technology users because the assistive technology, such as screen reader, will often read the source attribute (i.e., file name) as the alternative text. To tell assistive technology to ignore an image, use a "blank alternative text" attribute: \`alt=""\`.`,

heading: "Avoid emoji",
docs: "https://git.io/Jfhte",
docs: "https://tinyurl.com/yylrxrus",
suggestion: (value) => `Replace ${value || "emoji"} in alt text with descriptive text`,

@@ -183,0 +183,0 @@ rationale: `Emoji have their own text descriptions. These descriptions can vary between operating systems and software. The spoken description of the emoji may not match your visual intention.`,

{
"name": "@double-great/alt-text",
"version": "1.2.0-beta.4",
"version": "1.2.0-beta.5",
"description": "Check for unhelpful alt text.",

@@ -28,17 +28,17 @@ "main": "dist/index.js",

"dependencies": {
"cli-git.io": "^1.0.1",
"emoji-regex": "^10.0.0",
"github-slugger": "^1.4.0"
"github-slugger": "^1.4.0",
"tinyurl": "^1.1.7"
},
"devDependencies": {
"@babel/eslint-parser": "^7.16.5",
"@babel/preset-env": "^7.16.5",
"@babel/preset-env": "^7.16.8",
"@babel/preset-typescript": "^7.16.7",
"@types/github-slugger": "^1.3.0",
"@types/jest": "^27.4.0",
"@types/node": "^17.0.7",
"@types/node": "^17.0.8",
"eslint": "^8.6.0",
"eslint-config-prettier": "^8.3.0",
"husky": "^7.0.2",
"jest": "^27.4.5",
"jest": "^27.4.7",
"pinst": "^2.1.6",

@@ -58,6 +58,6 @@ "prettier": "^2.5.1",

"moduleNameMapper": {
"^./clues.js$": "<rootDir>/clues.ts",
"^./rules.js$": "<rootDir>/rules.ts"
"^./clues.js$": "<rootDir>/src/clues.ts",
"^./rules.js$": "<rootDir>/src/rules.ts"
}
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc