0.0.2 • Published 5 years ago
eslint-plugin-jsx-img-no-referrer v0.0.2
eslint-plugin-jsx-img-no-referrer
Using img tag with external source must have referrerPolicy="no-referrer"
Installation
You'll first need to install ESLint:
$ npm i eslint --save-devNext, install eslint-plugin-jsx-img-no-referrer:
$ npm install eslint-plugin-jsx-img-no-referrer --save-devUsage
Add jsx-img-no-referrer to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:
{
"plugins": ["jsx-img-no-referrer"]
}Then configure the rules you want to use under the rules section.
{
"rules": {
"jsx-img-no-referrer/jsx-img-no-referrer": "error"
}
}Custom image components
{
"settings": {
"react": {
"version": "detect"
},
"imageComponents": [
"Image",
{ "name": "Gravatar", "imageAttribute": "imageSrc" }
]
}
}License
MIT