eslint-plugin-jsx-img-no-referrer

0.0.2 • Public • Published

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:

$ 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

Package Sidebar

Install

npm i eslint-plugin-jsx-img-no-referrer

Weekly Downloads

38

Version

0.0.2

License

MIT

Unpacked Size

77 kB

Total Files

11

Last publish

Collaborators

  • darwintantuco