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 SeanHayes:no-adjacent-inline-elements branch 2 times, most recently from fc3405c to 1d54da5 Apr 19, 2017
Copy link
Collaborator

@ljharb ljharb left a comment

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 SeanHayes:no-adjacent-inline-elements branch 5 times, most recently from e82018c to 6479675 Apr 21, 2017
Copy link
Contributor Author

@SeanHayes SeanHayes left a comment

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


}
return {
JSXElement: function(node) {

This comment has been minimized.

@SeanHayes

SeanHayes Apr 22, 2017
Author Contributor

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
@yannickcr yannickcr force-pushed the yannickcr:master branch from f4737f0 to 73abadb Aug 9, 2017
@yannickcr yannickcr force-pushed the yannickcr:master branch from c8dedeb to dc9f85e Sep 24, 2017
@yannickcr yannickcr force-pushed the yannickcr:master branch from dca5cd5 to c148893 Nov 18, 2017
@ljharb ljharb force-pushed the SeanHayes:no-adjacent-inline-elements branch from 6479675 to 982a0a1 Dec 14, 2019
@ljharb ljharb force-pushed the SeanHayes:no-adjacent-inline-elements branch 3 times, most recently from 4cc3ac9 to 0d7019b Dec 28, 2019
@ljharb
ljharb approved these changes Dec 30, 2019
@ljharb ljharb merged commit 0d7019b into yannickcr:master Dec 30, 2019
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.005%) to 97.527%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants