eslint-plugin-jsx
JSX specific linting rules for ESLint
Last updated a year ago by jkroso .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install eslint-plugin-jsx 
SYNC missed versions from official npm registry.

eslint-plugin-jsx

JSX specific linting rules for ESLint. Designed for the semantics of the JSX-to-JS transpiler and is not compatible with the standard JSX semantics.

Installation

You need to install this plugin in the same place eslint itself is installed. So if your using a globally installed eslint this will also need to be installed globally

npm install -g eslint-plugin-jsx

then in your ~/.eslintrc:

{
  "plugins": ["jsx"],
  "rules": {
    "jsx/uses-factory": [1, {"pragma": "JSX"}],
    "jsx/factory-in-scope": [1, {"pragma": "JSX"}],
    "jsx/mark-used-vars": 1,
    "jsx/no-undef": 1
  }
}

jsx/no-undef also accepts a varsIgnorePattern which can be used to ignore certain undefined patterns (e.g. when using custom web elements).

jsx/no-undef also accepts a ignoreAttributes which can be used disregard linting of attributes (which incorrectly flags boolean attributes as undefined).

All those rules are defined by default though so you can leave out the ones you agree with.

Thanks

This project is based of yannickcr/eslint-plugin-react. Which has some rules you will probably also be interested in.

Current Tags

  • 0.1.0                                ...           latest (a year ago)

4 Versions

  • 0.1.0                                ...           a year ago
  • 0.0.2                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
  • 0.0.0                                ...           5 years ago

Copyright 2014 - 2016 © taobao.org |