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

Why is rule named "jsx-sort-prop-types"? #87

Closed
matthewwithanm opened this issue May 28, 2015 · 4 comments
Closed

Why is rule named "jsx-sort-prop-types"? #87

matthewwithanm opened this issue May 28, 2015 · 4 comments

Comments

@matthewwithanm
Copy link
Contributor

Sorry if this is a dumb question, but why does the "jsx-sort-prop-types" rule contain "jsx" in the name? It seems to me that it's just about component definitions.

@AlexKVal
Copy link
Contributor

#72

There was already jsx-sort-props rule in the plugin
and then was request #38 about sorting types of props, based on #16 jsx-sort-props sorted props.

So I've just named it as a sequel.

@yannickcr
Copy link
Member

Yes, there is no reason to have jsx- in this rule name since it is not related to JSX.
But I think we have some cleaning to do in rules names (only JSX related rules should be prefixed with jsx-, jsx-uses-react do not always use React since we now handle custom pragma, etc.)

@pwmckenna
Copy link
Contributor

@yannickcr if someone were to whip up a PR for this, should it be backwards compatible with regards to rule setting in .esslintrc etc?

@yannickcr
Copy link
Member

@pwmckenna I think we should rename the rule and keep the current one as an alias for now, but with a deprecation warning (like jsx-quotes).

Then, in a later time, remove it in a new major release.

lencioni added a commit to lencioni/eslint-plugin-react that referenced this issue Feb 8, 2016
This rule has nothing to do with JSX, so it doesn't make sense for "jsx"
to appear in its name.

To prevent breaking this rule for people, I have set up
jsx-sort-prop-types as an alias with a deprecation warning. Eventually,
we should remove it altogether. For the deprecation warning, I borrowed
code from jsx-quotes.

While I was at it, I corrected some minor wording issues in the
documentation for this rule (mostly using "propTypes" instead of
"propsTypes").

Fixes jsx-eslint#87.
lencioni added a commit to lencioni/eslint-plugin-react that referenced this issue Feb 8, 2016
This rule has nothing to do with JSX, so it doesn't make sense for "jsx"
to appear in its name.

To prevent breaking this rule for people, I have set up
jsx-sort-prop-types as an alias with a deprecation warning. Eventually,
we should remove it altogether. For the deprecation warning, I borrowed
code from jsx-quotes.

While I was at it, I corrected some minor wording issues in the
documentation for this rule (mostly using "propTypes" instead of
"propsTypes").

Fixes jsx-eslint#87.
@yannickcr yannickcr mentioned this issue Feb 9, 2016
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants