0.0.1 • Published 9 years ago

jscs-jsx-rules v0.0.1

Weekly downloads
7
License
MIT
Repository
github
Last release
9 years ago

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)

0.0.1

9 years ago