Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-jsx-extras

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-jsx-extras

A set of eslint rules to do custom JSX checks

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by25%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-jsx-extras

A set of Eslint plug-ins for app specific JSX based rules.

Currently this package has a single rule which is being used for the upclose.me website:

Rules

jsx-no-string-literals

This rule disallows the use of string literals (other than numbers) in a JSX expression. It exists so that a developer doesn't accidentally forget to put localized strings for a component.

no-untyped-react-exports

This rule is for using ES6 classes with flowtypes. It warns you if you are exporting a React ES6 class while passing it through a function:

export default autobind(MyReactClass)

This will work fine:

const toExport = autobind(MyReactClass)
export default toExport

As such this rule isn't perfect. You should be annotating the type for toExport:

const toExport: typeof MyReactClass = autobind(MyReactClass)
export default toExport

Future

Some rules that I'm currently working on:

  1. multiline-attributes-align: To check that JSX attributes are either limited to a single line or the attributes all match the same indentation.

  2. jsx-like-html: To check that a <br /> tag is always self closing, while a <span></span> tag is never self closing.

  3. jsx-ternary: To enforce indentation rules for ternary expressions in JSX.

  4. jsx-function-bind: For ES6 classes, a rule that will check that you use .bind(this) for callback functions in JSX.

Keywords

FAQs

Package last updated on 05 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc