willofindie / vscode-cssvar

VSCode extension to support CSS Variables Intellisense
https://marketplace.visualstudio.com/items?itemName=phoenisx.cssvar
MIT License
252 stars 4 forks source link

[Feat] ability to run linter in pre-commit / pre-push hook #77

Closed jjenzz closed 2 years ago

jjenzz commented 2 years ago

in the absence of a build step that can fail if there are type errors, it would be useful to be able to run the linter in a pre-commit / pre-push hook that can block the commit / push when errors are found.

(this is not a super important feature tho, definitely a nice to have / low priority)

jjenzz commented 2 years ago

hmmm, i actually wonder if a linter is not needed here because it has been brought to my attention that i could use stylelint for highlighting unknown variables instead, and it integrates well with CI.

edit: it doesn't look like stylelint will lint closed files either tho 🤔 😞

phoenisx commented 2 years ago

To my knowledge, users usually use a library to add git hooks or integration some flows in CI pipelines. This project is purely an extension and there's no node package for the same.

Not sure how you wanted to use this extension as a git hook or in the CI pipeline.

Do enlighten me if I am missing something here, where extensions can be used in CI pipelines?

jjenzz commented 2 years ago

Do enlighten me if I am missing something here, where extensions can be used in CI pipelines?

ah sorry, i wasn't proposing the extension is used in CI pipelines because as you say, that's not possible, but also didn't want to propose a solution here in case you had good ideas for handling this that i hadn't considered.

my thinking was that the extension could read a configuration file that can also be read by a cli based linter (to avoid configuration in two separate places) but given our recent conversations and change of direction, i am going to close this :)