linkedin / linkedin/css-blocks

Throw a meaningful error when there's a syntax mistake in composes

Open
#474 1 comment 0 reactions 0 assignees View on GitHub
@css-blocks/core
Dominant language
TypeScript
Stars
6.3k
Forks
154
PR merge metrics
No merged PRs in 30d

Description

Currently, `composes: a-block[type=butcher]` (value is not in quotes) results in an error that's not meaningful, like the following.
```Build Error (broccoli-css-blocks-analyze)

[css-blocks] BlockSyntaxError: No Block named "b-block" found in scope. (xxx/card.block.scss:18:3)```

We should throw an error that suggest a quoting the value instead.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the unquoted `composes: a-block[type=butcher]` example and trace how the syntax is parsed and reported. The issue is done when this mistake produces a meaningful error suggesting that the value be quoted, rather than the misleading missing-block error shown in the report.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.