Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@double-great/remark-lint-alt-text

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@double-great/remark-lint-alt-text - npm Package Compare versions

Comparing version 1.0.0-beta.2 to 1.0.0-beta.3

33

dist/index.js

@@ -15,8 +15,8 @@ import { lintRule } from "unified-lint-rule";

hasAltText = true;
if (!alt && !imageIsLink)
return;
if (!alt &&
imageIsLink &&
options &&
options["image-is-link"] !== false) {
if (!alt && !imageIsLink) {
const suggestion = altText(undefined, options);
if (suggestion)
file.message(suggestion, node);
}
if (!alt && imageIsLink && options["image-is-link"] !== false) {
file.message(imageLink.check(), node);

@@ -32,21 +32,16 @@ }

visitParents(tree, "image", aggregate);
Object.keys(textToNodes).map((alt) => {
for (const alt of Object.keys(textToNodes)) {
const nodes = textToNodes[alt];
if (!nodes)
return;
nodes.forEach((node) => {
if (hasAltText) {
const suggestion = altText(node.alt, options);
if (suggestion)
file.message(suggestion, node);
}
if (imageIsLink &&
hasAltText &&
options &&
options["image-is-link"] !== false) {
for (const node of nodes) {
const suggestion = altText(node.alt, options);
if (suggestion)
file.message(suggestion, node);
if (imageIsLink && hasAltText && options["image-is-link"] !== false) {
file.message(imageLink.check(), node);
}
});
});
}
}
});
export default checkAltText;
{
"name": "@double-great/remark-lint-alt-text",
"version": "1.0.0-beta.2",
"version": "1.0.0-beta.3",
"description": "A remark-lint plugin that finds unhelpful or missing image alt text",

@@ -14,3 +14,3 @@ "main": "dist/index.js",

"prepare": "husky install",
"prepublish": "tsc"
"prepublishOnly": "tsc"
},

@@ -17,0 +17,0 @@ "author": "@double-great",

@@ -22,1 +22,11 @@ # remark-lint-alt-text ![Build Status](https://github.com/double-great/remark-lint-alt-text/workflows/Test/badge.svg)

```
You can also customize suggestions:
```json
"remarkConfig": {
"plugins": [
["@double-great/remark-lint-alt-text", [1, { "empty-alt-text": false }]],
]
},
```
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc