Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Unexpected unknown property (property-no-unknown) #13

Closed
shripadk opened this issue Jan 23, 2017 · 3 comments
Closed

Unexpected unknown property (property-no-unknown) #13

shripadk opened this issue Jan 23, 2017 · 3 comments

Comments

@shripadk
Copy link

Not sure if this is related to #6 (please close if so) but it breaks with the following complex interpolation:

  const Button = styled.button`
    margin-${props => ((props.theme.dir === 'rtl') ? 'left' : 'right') }: 12.5px;
  `;

This is used for providing RTL support where the dir property can be set in ThemeProvider like so:

<ThemeProvider theme={{ dir: 'rtl' }}>
  <Button>Hello, World!</Button>
</ThemeProvider>

Stylelint throws the following error: Unexpected unknown property "margin-$undefined" (property-no-unknown).

@mxstbr mxstbr added the bug label Jan 30, 2017
@mxstbr
Copy link
Member

mxstbr commented Jan 30, 2017

Ah interesting, that's a bug that'll be interesting to fix! Mind submitting a PR with a failing test case? That'd be super helpful.

shripadk added a commit to shripadk/stylelint-processor-styled-components that referenced this issue Jan 30, 2017
- Failing test case for valid interpolations
- Real world failing test case (BidiButton)
@shripadk
Copy link
Author

Have submitted a PR with failing test cases. Let me know if you need anything else :)

@emilgoldsmith
Copy link
Member

This should be able to be handled with an sc-custom tag as added in #70 when we publish it in the near future.

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

No branches or pull requests

4 participants