GitXplorerGitXplorer
r

eslint-plugin-react-svg

public
7 stars
1 forks
8 issues

Commits

List of commits on branch master.
Verified
c0cb02604899156be9c085a8cd9d8f8ee7ead46b

Merge pull request #4 from raix/dependabot/npm_and_yarn/acorn-7.1.1

committed 5 years ago
Verified
52a5cdd6629977c2d39f3ba116a0e7d1ecbe7ea8

Bump acorn from 7.1.0 to 7.1.1

ddependabot[bot] committed 5 years ago
Unverified
4d4ef3802ebe4dca4c5df1c7bac2a0c1b3696c7d

no-unused-empty-tag cannot safely remove empty tags with attributes

committed 5 years ago
Unverified
d5428f005cf8c34f306e8eb961fa9ae552eab06d

Use empty array as children default

committed 5 years ago
Unverified
13cfecc26fe4f1f7e3aefb9a471cddd6bd67528e

Add placeholder script for semantic release

committed 5 years ago
Unverified
25cabb158016f3e18848f8587efc29858cb21b15

Add eslint

committed 5 years ago

README

The README file for this repository.

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