Closed simonsmith closed 7 years ago
I think Everything is OK. @giuseppeg Could U review this PR before I merge it?
to prematurely return if the css doesn't contain any @define directive i.e. there is no Component to reset.
Do you think that's needed here? Would be a breaking change. You can use SUIT and BEM without bem-linter
.
@simonsmith do you mean without having to add a @define
directive? I always add it anyway but yeah if it is a breaking change better not do it.
Unless we see this fix as a breaking change too because in a way it'll break the current behaviour
True, it could be seen as breaking but if it's fixing a bug I would say it was just a patch.
Regardless though, I didn't think this plugin should enforce usage of @define
. The main reason for that to exist is to derive the component name, which may not be needed in the future anyway and this plugin doesn't really care what your component name is, only that it exists.
I also wonder if users of BEM in particular use bem-linter
as much as SUIT.
I didn't think this plugin should enforce usage of `@define`
Agreed.
Up to you to decide whether to add the extra check before testing against the regexp – I am for add it. Either ways the branch is good to merge imo.
I see the logic in avoiding the regex 👍
Will add it
Okay, updated.
Please have a final look @maximkoretskiy @giuseppeg :)
🚢 🇮🇹
awesome work! thank you @simonsmith
Great!
This adds some extra test cases for SUIT selectors and makes the regex more robust against edge cases.
https://regex101.com/r/AA4xaq/3
Fixes #16
cc @giuseppeg