Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'identifier expected' error when using a string template followed by a pseudo-element selector #440

Open
Codex- opened this issue Dec 13, 2023 · 0 comments
Labels

Comments

@Codex-
Copy link

Codex- commented Dec 13, 2023

Describe the bug (including copyable syntax)

When writing a styled component with a string template, if you use a template for the identifier (a) followed by a pseudo selector (:after) it results in an error .${a}:after {

Screenshot
Screenshots are alway useful!
image

To Reproduce

const test = ''
const StyledDiv = styled.div`
  .${test}:before { // <- identifier expected (ts-styled-plugin(9999))
    border-bottom: none;
    transition: none;
  }
`

Expected behavior
No error as this is a valid identifier

Build environment (please complete the following information):

  • OS: Mac OS 14.1.2
  • VSCode Version: 1.85.0
  • Extension Version: 1.7.8

Extensions

code --list-extensions
DavidAnson.vscode-markdownlint
dbaeumer.vscode-eslint
eamodio.gitlens
EditorConfig.EditorConfig
esbenp.prettier-vscode
firsttris.vscode-jest-runner
github.vscode-github-actions
GitHub.vscode-pull-request-github
ms-azuretools.vscode-docker
ms-python.python
ms-python.vscode-pylance
ms-vscode-remote.remote-containers
ms-vscode-remote.remote-ssh
ms-vscode-remote.remote-ssh-edit
ms-vscode.cmake-tools
ms-vscode.cpptools
ms-vscode.cpptools-extension-pack
ms-vscode.cpptools-themes
ms-vscode.live-server
ms-vscode.remote-explorer
PKief.material-icon-theme
redhat.java
rust-lang.rust-analyzer
ryanluker.vscode-coverage-gutters
SonarSource.sonarlint-vscode
streetsidesoftware.code-spell-checker
styled-components.vscode-styled-components
tamasfe.even-better-toml
twxs.cmake
VisualStudioExptTeam.intellicode-api-usage-examples
VisualStudioExptTeam.vscodeintellicode
vscjava.vscode-java-debug
vscjava.vscode-java-dependency
vscjava.vscode-java-pack
vscjava.vscode-java-test
vscjava.vscode-maven
yoavbls.pretty-ts-errors
ZixuanChen.vitest-explorer

Additional context

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

No branches or pull requests

1 participant