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

Prevent adjacent inline elements not separated by whitespace. #1155

Merged
merged 1 commit into from Dec 30, 2019

Conversation

SeanHayes
Copy link
Contributor

@SeanHayes SeanHayes commented Apr 19, 2017

FYI, this is my first time writing an eslint rule.

I wrote this because I want to be warned when I have adjacent inline elements without any whitespace, as it affects the way the page looks when unstyled, and may affect the way search engines see the page.

Let me know if you think any changes are needed. If this is something you're interested in merging I'll add the related docs.

@SeanHayes SeanHayes force-pushed the no-adjacent-inline-elements branch 2 times, most recently from fc3405c to 1d54da5 Compare April 19, 2017 20:38
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this would not warn with {' '} (ie, explicit whitespace)? Could we add some tests for that?

lib/rules/no-adjacent-inline-elements.js Outdated Show resolved Hide resolved
lib/rules/no-adjacent-inline-elements.js Outdated Show resolved Hide resolved
lib/rules/no-adjacent-inline-elements.js Outdated Show resolved Hide resolved
@SeanHayes SeanHayes force-pushed the no-adjacent-inline-elements branch 5 times, most recently from e82018c to 6479675 Compare April 22, 2017 00:18
Copy link
Contributor Author

@SeanHayes SeanHayes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've addressed the feedback, added support for CallExpressions, and added a doc file.


}
return {
JSXElement: function(node) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure how to get this working with React.createElement(), thought I'd figure it out after getting some feedback.

lib/rules/no-adjacent-inline-elements.js Outdated Show resolved Hide resolved
lib/rules/no-adjacent-inline-elements.js Outdated Show resolved Hide resolved
@ljharb ljharb merged commit 0d7019b into jsx-eslint:master Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants