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

📎 Implement range suppression of plugin diagnostics #5175

Open
wanghaoPolar opened this issue Feb 22, 2025 · 2 comments
Open

📎 Implement range suppression of plugin diagnostics #5175

wanghaoPolar opened this issue Feb 22, 2025 · 2 comments

Comments

@wanghaoPolar
Copy link
Contributor

wanghaoPolar commented Feb 22, 2025

Description

related task: #4667

todo

Implement range suppression of plugin diagnostics

example:

// biome-ignore-start lint/plugin/preferObjectSpreadSuppression: reason
Object.assign({}, {foo: 'bar'});
// biome-ignore-end lint/plugin/preferObjectSpreadSuppression: reason

background

with current implementation #5139 , range suppression is not supported for plugin diagnostics

This is because:

  1. Plugin diagnosis is run after lint phases.
  2. During lint phase, range suppressions are dynamically updated while parsing // biome-range-start and // biome-range-end.
  3. Before plugin runs, every // biome-range-end has been processed, and its corresponding range suppression is cleared.

for now, when user try to use range suppression on plugin, will report an error.

  ! Found a biome-ignore-<range> suppression on plugin. This is not supported. See https://github.com/biomejs/biome/issues/5175
  
    4 │ // biome-ignore-start plugin/preferObjectSpreadSuppression: reason
    5 │ Object.assign({}, {foo: 'bar'});
  > 6 │ // biome-ignore-end plugin/preferObjectSpreadSuppression: reason
      │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    7 │ 
  
  i Remove this suppression.
@ematipico
Copy link
Member

The suppression should still refer to the tool they are using.

Biome suppression comments start with lint or format.

I think we should be consistent here too, and use plugin/lint or lint/plugin too.

@wanghaoPolar
Copy link
Contributor Author

Thanks for your suggestion👍 . I have updated to use lint/plugin.

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

No branches or pull requests

2 participants