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

feat(biome_css_analyzer): noCssEmptyBlock #2513

Merged
merged 15 commits into from
Apr 19, 2024

Conversation

togami2864
Copy link
Contributor

Summary

close #2512
Implement block-no-empty

Test Plan

added tests and snapshots

@github-actions github-actions bot added A-Project Area: project A-Parser Area: parser L-CSS Language: CSS A-Diagnostic Area: diagnostocis labels Apr 18, 2024
@togami2864 togami2864 self-assigned this Apr 18, 2024
Copy link

codspeed-hq bot commented Apr 18, 2024

CodSpeed Performance Report

Merging #2513 will improve performances by 6.38%

Comparing togami2864:feat/no-css-empty-block (d390719) with main (00bae2a)

Summary

⚡ 1 improvements
✅ 92 untouched benchmarks

Benchmarks breakdown

Benchmark main togami2864:feat/no-css-empty-block Change
db.json[cached] 75.3 ms 70.8 ms +6.38%

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I think the option should be revisited because it's very hard to understand what it does... and why ["comments"]?

use serde::{Deserialize, Serialize};

declare_rule! {
/// Disallow css empty blocks.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Disallow css empty blocks.
/// Disallow CSS empty blocks.

declare_rule! {
/// Disallow css empty blocks.
///
/// This rule disallows empty block.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// This rule disallows empty block.

Repetition of the previous sentence.

/// {
/// "noCssEmptyBlock": {
/// "options": {
/// "ignore": ["comments"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option - coming from Styelint- isn't very... good. If by adding this option we allow comments in blocks, then why not "options": { "allowComments": true }?

Also, it's really hard to understand what's the default behaviour of the rule, which we should explain in the documentation.

rule_category!(),
span,
markup! {
"Unexpected empty block is not allowed"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Unexpected empty block is not allowed"
"Empty blocks aren't allowed."

@ematipico ematipico merged commit 5477979 into biomejs:main Apr 19, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Diagnostic Area: diagnostocis A-Parser Area: parser A-Project Area: project L-CSS Language: CSS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📎 Implement block-no-empty
2 participants