Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
remark-lint-no-empty-image-alt-text
Advanced tools
remark-lint rule to warn when alt text for image will be missing
This remark-lint rule is created to check if all images have alt text or not. This will help to get standard accessibility for images.
<!-- Invalid -->
![](<image-path>)
<!-- Valid -->
![alt text](<image-path>)
remark
Let’s say example.js
looks as follows:
var report = require('vfile-reporter')
var remark = require('remark')
var remarkLint = require('remark-lint');
var imageAltText = require('remark-lint-no-empty-image-alt-text')
var file = remark()
.use(remarkLint)
.use(imageAltText)
.processSync('![](./media/example.png)')
console.log(report(file))
Now, running node example.js
yields:
1:1-1:25 warning Missing alt text for image! no-empty-image-alt-text remark-lint
⚠ 1 warning
.remarkrc
npm install -g remark-cli
npm install remark-lint remark-lint-no-empty-image-alt-text
Then, set up your .remarkrc
:
{
"plugins": [
"lint",
"lint-no-empty-image-alt-text"
]
}
Now you can use the following command to run the lint:
remark xxx.md
npm install -g remark-cli
npm install remark-lint remark-lint-no-empty-image-alt-text
remark -u lint -u lint-no-empty-image-alt-text xxx.md
FAQs
remark-lint rule to warn when alt text for image will be missing
The npm package remark-lint-no-empty-image-alt-text receives a total of 185 weekly downloads. As such, remark-lint-no-empty-image-alt-text popularity was classified as not popular.
We found that remark-lint-no-empty-image-alt-text demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.