jscs-jsx-rules

0.0.1 • Public • Published

JSX rules for JSCS

What Is It

Currently, this plugin provides a single rule to help enforce spacing inside of JSX expression containers.

Usage

To enable this plugin, your JSCS configuration would need to include:

{
  "plugins": [ "jscs-jsx-rules" ]
}

Rules

disallowSpacesInsideJsxExpressionContainers

Disallows spaces after the opening curly brace and before the closing curly brace of a JSX expression container.

Type: Boolean

Value: true

Example

"disallowSpacesInsideJsxExpressionContainers": true

Valid

function render() {
	return <div>{this.props.name}</div>;
}

Invalid

function render() {
	return <div>{ this.props.name }</div>;
}

requireSpacesInsideJsxExpressionContainers

Requires that there are spaces after the opening curly brace and before the closing curly brace of a JSX expression container.

Type: Boolean

Value: true

Example

"requireSpacesInsideJsxExpressionContainers": true

Valid

function render() {
	return <div>{ this.props.name }</div>;
}

Invalid

function render() {
	return <div>{this.props.name}</div>;
}

License

MIT (http://www.opensource.org/licenses/mit-license.php)

Readme

Keywords

Package Sidebar

Install

npm i jscs-jsx-rules

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • rniemeyer