Comments (2)
swc has the same problem: https://swc-css.netlify.app/?code=eJzLTczMU6jm4sxJTErNscrIL0stAnE50_LzSnTLUzPTM0qsFEwNDKy5OGu5agFeiw4W
Workaround:
main {
& label:hover {
font-weight: 500;
}
}
The problem is that it's impossible to understand if the next element is a property declaration or a pseudo-class with a type selector. We can try to check the token after :
and see if it's a known pseudo-class. Do you think this is a good solution?
from biome.
Thanks for checking this issue!
swc has the same problem: https://swc-css.netlify.app/?code=eJzLTczMU6jm4sxJTErNscrIL0stAnE50_LzSnTLUzPTM0qsFEwNDKy5OGu5agFeiw4W
I wonder what the "Allow legacy nesting" option means in swc. If I enable it, it seems to parse the selector with pseudo classes correctly. And if I disable it, it won't parse nesting selectors at all, even without a pseudo class: https://swc-css.netlify.app/?code=eJzLTczMU6jm4sxJTErNATE40_LzSnTLUzPTM0qsFEwNDKy5OGu5agH83Au4
The problem is that it's impossible to understand if the next element is a property declaration or a pseudo-class with a type selector. We can try to check the token after
:
and see if it's a known pseudo-class. Do you think this is a good solution?
I'm not sure about checking for known pseudo classes. I have a very limited knowledge about how our parser works and the CSS spec. But I wonder if it is possible to backtrack when it encounters an opening curly brace {
if it erroneously reads it as a property declaration the first pass?
I do think the workaround is good enough for users who encounter this problem!
from biome.
Related Issues (20)
- 🐛 Parser is no longer progressing HOT 9
- 💅 lint/suspicious/noDuplicateTestHooks : Duplicate test hook when using describe.each
- 💅 Transform a function with generics to arrow function by biome linter will not safe. HOT 2
- 🐛 Biome client: couldn't create connection to server. HOT 3
- 📎 Refactor/fix `JsParserSettings` for better override behavior HOT 4
- 💅 noCommentText does not work when any other text is a child
- 📎 Multi-file support HOT 7
- 💅 `useAdjacentOverloadSignatures` does not distinguish between public and private fields. HOT 4
- ☂️ GraphQL formatter HOT 3
- 💅 No equivalent for `no-undef` without any globals HOT 1
- 🐛 CSS Parser error for color inherit and a:link, a:visited HOT 4
- 💅 lint/a11y/useAltText asks for alt text even for aria-hidden images
- StringValue
- 🐛 LSP formatting not working in Helix HOT 1
- 📎 Embedded language formatting HOT 1
- 💅 useHookAtTopLevel - false-positives for `jest.useFakeTimers`/`jest.useRealTimers` HOT 4
- Proposal to rename "quickfix.biome" to "source.fixAll.biome" HOT 2
- 💅 React deps recommendations do not match useExhaustiveDeps rule HOT 1
- 📝 Ignore option not respected
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from biome.