Skip to content

Commit a7764f7

Browse files
committed
readme update
Add fixable for readme and update docs to reflect additional argument
1 parent f15b117 commit a7764f7

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Finally, enable all of the rules that you would like to use. Use [our preset](#
117117
* [react/jsx-curly-spacing](docs/rules/jsx-curly-spacing.md): Enforce or disallow spaces inside of curly braces in JSX attributes (fixable)
118118
* [react/jsx-equals-spacing](docs/rules/jsx-equals-spacing.md): Enforce or disallow spaces around equal signs in JSX attributes (fixable)
119119
* [react/jsx-filename-extension](docs/rules/jsx-filename-extension.md): Restrict file extensions that may contain JSX
120-
* [react/jsx-first-prop-new-line](docs/rules/jsx-first-prop-new-line.md): Enforce position of the first prop in JSX
120+
* [react/jsx-first-prop-new-line](docs/rules/jsx-first-prop-new-line.md): Enforce position of the first prop in JSX (fixable)
121121
* [react/jsx-handler-names](docs/rules/jsx-handler-names.md): Enforce event handler naming conventions in JSX
122122
* [react/jsx-indent](docs/rules/jsx-indent.md): Validate JSX indentation
123123
* [react/jsx-indent-props](docs/rules/jsx-indent-props.md): Validate props indentation in JSX (fixable)

docs/rules/jsx-first-prop-new-line.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Ensure correct position of the first property.
44

5+
**Fixable:** This rule is automatically fixable using the `--fix` flag on the command line.
6+
57
## Rule Details
68

79
This rule checks whether the first property of all JSX elements is correctly placed. There are three possible configurations:
@@ -10,6 +12,12 @@ This rule checks whether the first property of all JSX elements is correctly pla
1012
* `multiline`: The first property should always be placed on a new line when the JSX tag takes up multiple lines.
1113
* `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.
1214

15+
In order to utilise autofix, please specify the indentation style as an additional argument in your configuration:
16+
17+
```json
18+
"jsx-first-prop-new-line": ["always", 2]
19+
```
20+
1321
The following patterns are considered warnings when configured `"always"`:
1422

1523
```jsx

0 commit comments

Comments
 (0)