Skip to content

Commit

Permalink
readme update
Browse files Browse the repository at this point in the history
Add fixable for readme and update docs to reflect additional argument
  • Loading branch information
snowypowers committed Nov 2, 2016
1 parent f15b117 commit a7764f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Finally, enable all of the rules that you would like to use. Use [our preset](#
* [react/jsx-curly-spacing](docs/rules/jsx-curly-spacing.md): Enforce or disallow spaces inside of curly braces in JSX attributes (fixable)
* [react/jsx-equals-spacing](docs/rules/jsx-equals-spacing.md): Enforce or disallow spaces around equal signs in JSX attributes (fixable)
* [react/jsx-filename-extension](docs/rules/jsx-filename-extension.md): Restrict file extensions that may contain JSX
* [react/jsx-first-prop-new-line](docs/rules/jsx-first-prop-new-line.md): Enforce position of the first prop in JSX
* [react/jsx-first-prop-new-line](docs/rules/jsx-first-prop-new-line.md): Enforce position of the first prop in JSX (fixable)
* [react/jsx-handler-names](docs/rules/jsx-handler-names.md): Enforce event handler naming conventions in JSX
* [react/jsx-indent](docs/rules/jsx-indent.md): Validate JSX indentation
* [react/jsx-indent-props](docs/rules/jsx-indent-props.md): Validate props indentation in JSX (fixable)
Expand Down
8 changes: 8 additions & 0 deletions docs/rules/jsx-first-prop-new-line.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Ensure correct position of the first property.

**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.

## Rule Details

This rule checks whether the first property of all JSX elements is correctly placed. There are three possible configurations:
Expand All @@ -10,6 +12,12 @@ This rule checks whether the first property of all JSX elements is correctly pla
* `multiline`: The first property should always be placed on a new line when the JSX tag takes up multiple lines.
* `multiline-multiprop`: The first property should always be placed on a new line if the JSX tag takes up multiple lines and there are multiple properties.

In order to utilise autofix, please specify the indentation style as an additional argument in your configuration:

```json
"jsx-first-prop-new-line": ["always", 2]
```

The following patterns are considered warnings when configured `"always"`:

```jsx
Expand Down

0 comments on commit a7764f7

Please sign in to comment.