Skip to content

Commit

Permalink
[change] eslint-plugin-react - use jsx-tag-spacing instead of jsx-spa…
Browse files Browse the repository at this point in the history
…ce-before-closing
  • Loading branch information
Simon Mollweide committed Jun 4, 2017
1 parent 9eea189 commit 0ac94b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 2 additions & 4 deletions documentation/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,9 @@ const Hello2 = require('./Hello');



### [Jsx space before closing](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-space-before-closing.md)
### [Jsx tag spacing](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md)

> Enforce spaces before the closing bracket of self-closing JSX elements
> Enforce or forbid spaces after the opening bracket, before the closing bracket of self-closing elements, and between the angle bracket and slash of JSX closing or self-closing elements.

✓ Enabled (error)
Expand Down Expand Up @@ -1053,5 +1053,3 @@ Test2.propTypes = {
✓ Enabled (error)

<br />


10 changes: 7 additions & 3 deletions rules/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,12 @@ module.exports = {
'react/self-closing-comp': 2,

// Enforce spaces before the closing bracket of self-closing JSX elements
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-space-before-closing.md
'react/jsx-space-before-closing': [2, 'always'],
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md
'react/jsx-tag-spacing': [2, {
'closingSlash': 'never',
'beforeSelfClosing': 'always',
'afterOpening': 'never',
}],

// Enforce component methods order
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md
Expand Down Expand Up @@ -213,7 +217,7 @@ module.exports = {
'react/jsx-indent': [2, 'tab'],
// [11.07.2016] changed to tabs

// disallow target="_blank" on links
// disallow target="_blank' on links
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
'react/jsx-no-target-blank': 0,
},
Expand Down

0 comments on commit 0ac94b1

Please sign in to comment.