menu
announcement

Spectrum is now read-only. Learn more about the decision in our official announcement.

styled-components

Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress!

Channels
Team

styled-components with stylelint & babel-proposal-optional-chaining

May 14, 2018 at 2:23pm

styled-components with stylelint & babel-proposal-optional-chaining

May 14, 2018 at 2:23pm
Any one experience with using stylelint and optional chaining in an project?
I am trying to implement both in an project, where optional-chaining is used for the default theming of components.
But as soon as optional-chaining is used in a file, stylelint won't find any errors and says everything is ok, even if it isn't so.
Examples:
const Button = styled.button`
background-color: white // no error (missing semicolon)
border-color: ${props => props.theme.button?.borderColor || 'transparent'};
`
const Button = styled.button`
background-color: white // missing semicolon
border-color: ${props.theme.button.borderColor};
`
Hope this is the right channel for this question :)

May 14, 2018 at 2:50pm
Hmm, that's very curious
Can you open an issue in the processor repo with a failing test? That'd be super helpful
like-fill
1

May 15, 2018 at 6:00am