Skip to content

sbason/eslint-plugin-inferno

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESLint-plugin-Inferno

Note: This is a fork of the great eslint-plugin-react.

Inferno specific linting rules for ESLint Rules are mostly same, but propType related rules have been removed.

Installation

Install ESLint either locally or globally.

$ npm install eslint --save-dev

If you installed ESLint globally, you have to install Inferno plugin globally too. Otherwise, install it locally.

$ npm install eslint-plugin-inferno --save-dev

Configuration

Add plugins section and specify ESLint-plugin-Inferno as a plugin.

{
  "plugins": [
    "inferno"
  ]
}

You can also specify some settings that will be shared across all the plugin rules.

{
  "settings": {
    "inferno": {
      "pragma": "Inferno"  // Pragma to use, default to "Inferno"
    }
  }
}

If it is not already the case you must also configure ESLint to support JSX.

With ESLint 1.x.x:

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

With ESLint 2.x.x or 3.x.x:

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

Finally, enable all of the rules that you would like to use. Use our preset to get reasonable defaults quickly, and/or choose your own:

  "rules": {
    "inferno/jsx-uses-inferno": "error",
    "inferno/jsx-uses-vars": "error",
  }

List of rules NOT part of inferno

These rules have been removed, because they are invalid in Inferno

List of supported rules

JSX-specific rules

Other useful plugins

Shareable configurations

Recommended

This plugin exports a recommended configuration that enforce Inferno good practices.

To enable this configuration use the extends property in your .eslintrc config file:

{
  "extends": ["eslint:recommended", "plugin:inferno/recommended"]
}

See ESLint documentation for more information about extending configuration files.

The rules enabled in this configuration are:

All

This plugin also exports an all configuration that includes every available rule. This pairs well with the eslint:all rule.

{
  "plugins": [
    "inferno"
  ],
  "extends": ["eslint:all", "plugin:inferno/all"]
}

Note: These configurations will import eslint-plugin-inferno and enable JSX in parser options.

License

ESLint-plugin-Inferno is licensed under the MIT License.

About

React specific linting rules for ESLint

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%