csstree / vscode-plugin

CSSTree validation plugin for VS Code
MIT License
17 stars 4 forks source link

(Enhancement) Ignore particular lines #5

Open HiEv opened 4 years ago

HiEv commented 4 years ago

Could you add an option to have this VSCode extension ignore particular lines? For example, any line that includes "/* csstree-ignore-line */".

I have some code in my CSS for older browsers (e.g. -webkit-margin-before:, -webkit-margin-after:, width: -webkit-fill-available, width: -moz-available, and width: fill-available), which are reported as errors, and I'd rather have an empty "Problems" window in VSCode. Giving me a way to have your extension not report those lines as errors would really be appreciated.

Thank you, and thank you for the VSCode extension. :smiley:

timohofmeijer commented 4 years ago

I'd also like to be able to do this. In my case to silence a validator error when using font-display.

@font-face {
  font-display: swap;
}

see: https://github.com/csstree/csstree/issues/108

HarryAdney commented 3 years ago

Any update on this?

lahmatiy commented 3 years ago

Issue with font-display is not an issue anymore, since plugin validates at-rule's declarations based on a dictionary for at-rules now.

I believe that comments is not a good approach to disable validation.

Options we have:

antefix-consulting commented 3 years ago

The 'csstree-ignore-line' comment would be a great way to handle this. It's flexible, easy to understand and apply, and wouldn't require any configuration changes.