eslint-plugin-jsx-img-no-referrer
v0.0.2
Published
Using img tag with external source must have referrerPolicy='no-referrer'
Downloads
195
Maintainers
Readme
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-dev
Next, install eslint-plugin-jsx-img-no-referrer
:
$ npm install eslint-plugin-jsx-img-no-referrer --save-dev
Usage
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