Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

add rules for spacing and quotes #3

Merged
merged 1 commit into from
Nov 6, 2016
Merged

add rules for spacing and quotes #3

merged 1 commit into from
Nov 6, 2016

Conversation

carlows
Copy link
Contributor

@carlows carlows commented Oct 24, 2016

I haven't test this in hashdard because I'm not sure how to use a custom config to test it (as they're fetch from the package.json I suppose).

jsx-quotes allows to lint this as error:

<a b='c' />
<b c="d" /> // this is fine

The other rule I added is jsx-curly-spacing, this rule lints the following as an error:

<Component
  foo={prop1}
  bar={ prop2}
/>

<Component
  foo={ prop1 } // this is fine
/>

However, as mentioned here the rule does not work for:

<Component>
  {something}
</Component>

Screenshots

image

image

@duranmla
Copy link

But the thing is that we don't know if this actually works @carlows ?

@carlows
Copy link
Contributor Author

carlows commented Oct 24, 2016

@duranmla i didn't test them with hashdard, but i tested them with eslint. the jsx-quotes rule doesn't need any plugins to work, and the jsx-curly-spacing needs the react-plugin, but it is included in standard

Copy link

@duranmla duranmla left a comment

Choose a reason for hiding this comment

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

Cool! LGTM

@orlando orlando merged commit c8bea6e into master Nov 6, 2016
@orlando
Copy link
Member

orlando commented Nov 6, 2016

@carlows thanks!

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

Successfully merging this pull request may close these issues.

3 participants