This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

eslint-plugin-react-svg

0.0.4 • Public • Published

eslint-plugin-react-svg Build Status

SVG specific rules for react

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-react-svg:

$ npm install eslint-plugin-react-svg --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-react-svg globally.

Configuration

Using the preset

  "extends"[
    "eslint:recommended",
    "plugin:react-svg/recommended"
  ]

Using manual configuration

Add react-svg to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "react-svg"
    ]
}

Enable JSX support

{
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    }
  }
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "react-svg/no-unused-ids-in-svg": 2,
        "react-svg/no-unused-empty-tag-in-svg": 2,
        "react-svg/no-metadata-in-svg": 2
    }
}

Supported Rules

Package Sidebar

Install

npm i eslint-plugin-react-svg

Weekly Downloads

283

Version

0.0.4

License

MIT

Unpacked Size

32.2 kB

Total Files

21

Last publish

Collaborators

  • raix