Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsx-tag-spacing doesn't allow for forbid a space before ">" in a start tag #1396

Closed
mmsbrggr opened this issue Aug 25, 2017 · 8 comments
Closed

Comments

@mmsbrggr
Copy link

mmsbrggr commented Aug 25, 2017

In our project we have the need for forbidding spaces before the ">" symbol in a start tag. For example the following should not be allowed:

<RectangleSelection
    minWidth={150}
    minHeight={50} >
    {children}
</RectangleSelection>

In comparison the following should not result in an error:

<RectangleSelection
    minWidth={150}
    minHeight={50}>
    {children}
</RectangleSelection>
@jseminck
Copy link
Contributor

Would you be up for making a PR for this feature? I had a quick look today, and it shouldn't be that complicated as the code will be quite similar to how the current beforeSelfClosing option works.

I'm ready to assist if needed.

We'll need to add a new option to support this though, I don't know what the name should be. Perhaps simply beforeClosing ?

@ljharb
Copy link
Member

ljharb commented Aug 31, 2017

beforeClosing might be </ - does the rule already handle < ?

@cjskillingstad
Copy link
Contributor

PR opened here: #1641

@ljharb
Copy link
Member

ljharb commented Jan 12, 2018

Closed by #1641.

@ljharb ljharb closed this as completed Jan 12, 2018
@danrot
Copy link

danrot commented Jan 15, 2018

Any idea when this will be released?

@caub
Copy link

caub commented Feb 5, 2018

I still have this issue, this PR has not been released?

"react/jsx-tag-spacing": ["error", {
			"closingSlash": "never",
			"beforeSelfClosing": "always",
			"afterOpening": "never",
			"beforeClosing": "never"
		}],
<Foo >foo</Foo >

is allowed

Btw I also have this error:

Configuration for rule "react/jsx-tag-spacing" is invalid:
	Value {"closingSlash":"never","beforeSelfClosing":"always","afterOpening":"never","beforeClosing":"never"} should NOT have additional properties.

but I follow the format of this rule described in Readme, (using "eslint-plugin-react": "^7.6.1")

edit: right, it complains about this new beforeClosing prop, added in README but not published on npm

@ljharb
Copy link
Member

ljharb commented Feb 5, 2018

It’s published in v7.6; are you sure you’re running a local eslint?

@caub
Copy link

caub commented Feb 5, 2018

npm list -g --depth=0 doesn't show any eslint modules, and the repo has no node_modules in a parent folder

if I write <Searchbar > it propose me to fix to <Searchbar >, not <Searchbar> (which is also valid, but I'd like to enforce this convention)

Edit: well, it seems I forgot to uncomment "beforeClosing": "never", it's working, sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants