43081j / 43081j/postcss-styled-components
Exception error detected by stylelint
- 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ả
Hello, when I use the following stylelint configuration to format styled-components, when I write styled-components in the tsx file, as long as I write the code, the stylelint plugin of vscode will detect an exception and report an error
This is the configuration of stylelint
{
"extends": ["stylelint-config-rational-order", "stylelint-config-standard"],
"plugins": ["stylelint-order"],
"customSyntax": "postcss-styled-components"
}
This is the error message
SyntaxError: Unexpected keyword 'function'. (11:0) at instantiate (E:\GProjects\UI\node_modules\.pnpm\@babel+parser@7.21.2\node_modules\@babel\parser\lib\index.js:64:32) at constructor

When I don't use postcss-styled-components, no such error message will appear, but at the same time, I can't format styled-components
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
Hướng nghiên cứu
The issue is about a syntax error when using postcss-styled-components with stylelint in VS Code for styled-components in TSX files. Start by examining the custom syntax plugin's parsing logic, likely in the main source files of the repository. Reproduce the error with the given stylelint configuration and a sample TSX file containing styled-components. Check how the plugin handles the 'function' keyword in the context of styled-components. Look at existing tests to understand expected behavior and add a test case for this scenario.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- typescript
- Lĩnh vực
- developer-experience, tooling
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100