parcel-bundler / parcel-bundler/lightningcss
Incorrect error message for `@layer` between `@import`s
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.7k
- Forks
- 302
- PR merge metrics
- No merged PRs in 30d
Description
The following CSS is invalid as the @import is not consecutive.
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+KR:wght@100;200;300;400;500;600;700&display=swap');
@layer reset, base, variant, state, component;
@import url(./tester.css) layer(base);
If this CSS is input, lightningcss errors with the following message:
@import rules must precede all rules aside from @charset and @layer statements
This message is true, but doesn't apply to this input. @import does precede all other statements aside from @layer.
In this case, I think the error message needs to be something like "@import must be consecutive".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CSS snippet and linked lightningcss playground reproduction to observe the current diagnostic. Locate the parser or diagnostic handling for @import and @layer, then verify that the message describes the non-consecutive @import case and that the reproduction no longer reports the misleading wording.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100