Skip to content

darwintantuco/eslint-plugin-jsx-img-no-referrer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-plugin-jsx-img-no-referrer

Node.js CI

Using img tag with external source must have referrerPolicy="no-referrer"

Installation

You'll first need to install ESLint:

Next, install eslint-plugin-jsx-img-no-referrer:

npm

$ npm install eslint-plugin-jsx-img-no-referrer --save-dev

yarn

$ yarn add eslint-plugin-jsx-img-no-referrer --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"
  }
}

If you have custom image components, you can define them under settings section.

{
  "settings": {
    "imageComponents": [
      "Avatar",
      { "name": "Profile", "imageAttribute": "imageSrc" }
    ]
  }
}

License

MIT

About

Using img tag with external source must have referrerPolicy="no-referrer"

Resources

License

Stars

Watchers

Forks

Packages

No packages published