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

Add option to the self-closing-comp #600

Merged
merged 5 commits into from
Jun 5, 2016
Merged

Add option to the self-closing-comp #600

merged 5 commits into from
Jun 5, 2016

Conversation

gitim
Copy link
Contributor

@gitim gitim commented May 14, 2016

This pr adds an option to the self-closing-comp suggested #572, which is corresponding what type of tags ({component: <boolean>, html: <boolean>}) should be self-closed when this is possible. Note: this not changes current behavior, default option is {component: true, html: false}, but in the next major
release we can change it to {component: true, html: true} to enforce all tags to be self-closing when that is possible.

@coveralls
Copy link

coveralls commented May 14, 2016

Coverage Status

Coverage increased (+0.005%) to 96.823% when pulling 700dab4 on gitim:fix-self-closing-comp into 750f979 on yannickcr:master.

@coveralls
Copy link

coveralls commented May 14, 2016

Coverage Status

Coverage increased (+0.005%) to 96.823% when pulling 52f0f8e on gitim:fix-self-closing-comp into 750f979 on yannickcr:master.

@gitim gitim changed the title Add options to the self-closing-comp Add option to the self-closing-comp May 14, 2016
@coveralls
Copy link

coveralls commented May 14, 2016

Coverage Status

Coverage increased (+0.005%) to 96.823% when pulling 702570d on gitim:fix-self-closing-comp into 750f979 on yannickcr:master.


## Rule Options

It takes an option as the second parameter, which corresponding what components tags should be self-closed when this is possible.
Copy link
Member

Choose a reason for hiding this comment

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

We should indicate which is the default here - "component" i think.

@coveralls
Copy link

coveralls commented May 15, 2016

Coverage Status

Coverage increased (+0.005%) to 96.823% when pulling 2978369 on gitim:fix-self-closing-comp into 750f979 on yannickcr:master.

@coveralls
Copy link

coveralls commented May 15, 2016

Coverage Status

Coverage increased (+0.005%) to 96.823% when pulling d392381 on gitim:fix-self-closing-comp into 750f979 on yannickcr:master.

```js
...
"self-closing-comp": [<enabled>, {
"component" <boolean> || true,
Copy link
Member

Choose a reason for hiding this comment

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

|| true means it will never be false, so i don't think this is good notation. I'd just provide the default object:

"self-closing-comp": ["error", {
  "component": true,
  "html": false
}]

I think it's pretty self-apparent that you can override them with your own booleans

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, fixed

@coveralls
Copy link

coveralls commented May 15, 2016

Coverage Status

Coverage increased (+0.005%) to 96.823% when pulling 74b103d on gitim:fix-self-closing-comp into 750f979 on yannickcr:master.

@ljharb
Copy link
Member

ljharb commented May 15, 2016

Just to be safe, could we also add tests with the options object omitted?

@gitim
Copy link
Contributor Author

gitim commented May 15, 2016

Just to be safe, could we also add tests with the options object omitted?

Yes, sure. Just copied all tests without options and pasted with adding options: [].

@coveralls
Copy link

coveralls commented May 15, 2016

Coverage Status

Coverage increased (+0.005%) to 96.823% when pulling 756008b on gitim:fix-self-closing-comp into 750f979 on yannickcr:master.

@ljharb
Copy link
Member

ljharb commented May 15, 2016

LGTM but i'll let @yannickcr do the merging since i'm pretty weak on parser code

@gitim
Copy link
Contributor Author

gitim commented May 28, 2016

@yannickcr, are there any plans to release this fix?

@yannickcr
Copy link
Member

@gitim Yes, but I'm currently in holidays and this until the 1st June, then I will be at React Europe on 2-3 June. So do not expect a lot of activity from me until the 4th June.

@yannickcr yannickcr merged commit ade9e77 into jsx-eslint:master Jun 5, 2016
@yannickcr
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

4 participants