43081j / 43081j/postcss-styled-components

Exception error detected by stylelint

Ouverte
#10 4 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
TypeScript
Étoiles
12
Forks
1
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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
![企业微信截图_16784128377413](https://user-images.githubusercontent.com/54523778/224203120-e3517962-549b-48e6-8f53-999d19e20ec0.png)

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
typescript
Domaine
developer-experience, tooling
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.