43081j / 43081j/postcss-styled-components

Autofix generates invalid code with nested style blocks

Đang mở
#9 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
12
Fork
1
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Test case 1:

```tsx
const Div = styled.div`
${css`
color: blue;
`}
`;
```

This code yields the error `Skipping template… as it included either invalid syntax or complex expressions the plugin could not interpret`, as described at #7.

Test case 2:

```tsx
const Div = styled.div`
${css`
color: blue;
`}

div {
position: absolute;
}
`;
```

This yields the error `Unexpected unknown type selector "POSTCSS_styled-components_0" (selector-type-no-unknown)` on the `${}` line. But what's really strange is what happens if you run stylelint with `--fix`. The output is this invalid code:

```tsx
const Div = styled.div`
${css`
color: blue;
`}

div {
position: absolute;
}
color: blue;
`}

div {
position: absolute;
}
`;
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.