postcss / postcss-bem-linter

A BEM linter for postcss
MIT License
572 stars 35 forks source link

Update to PostCSS 4.1 #32

Closed davidtheclark closed 9 years ago

davidtheclark commented 9 years ago

It's nifty new messages API is well-suited to linting. If I understand correctly (still have to look into it more), we'd be able to accumulate all the errors and show them all at once to the user, instead of throwing one error at a time.

MoOx commented 9 years ago

That's exactly what I requested to @ai for stylelint and he loved the idea ;)

davidtheclark commented 9 years ago

After the discussion following this comment, I'm thinking that maybe what this linter could do for now (at least until something like stylelint is ready with a standard "linter" interface) is this:

If we do those things I'm thinking we'd probably be well prepared to integrate with whatever comes later, while being able to use the thing now.

Would that fit your workflow @necolas? Do you have any disagreements?

ai commented 9 years ago

BTW, you can add some PostCSS plugin, that will throw a error if Result contains warnings from linter.

davidtheclark commented 9 years ago

Interesting idea @ai.

necolas commented 9 years ago

Sounds good to me

MoOx commented 9 years ago

I also plan to add the ability to lint files directly when @imported (would save some fs call). Using this API would help to defer all messages at the same moment (ref https://github.com/cssnext/cssnext/issues/64)