This repository was archived by the owner on Apr 6, 2021. It is now read-only.
Fixed issue with negative classes not being generated when used with a prefix. #114
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #42.
As far as I understood the code, it was checking for the first character to be a
-
to treat it as a negative class. However, it's not guaranteed that-
will always be the first character as the user can freely set a prefix in their config file.It follows, then, that a class will be negative if the first character after the prefix is
-
.What we want to do here is
candidatePrefix
so that given atw--ml-4
classtw-ml-4
can be passed to the generatorFrom that point on the logic stays exactly the same, that is, when the negative flag is set, the modifier from the candidate will be prefixed with a
-
.I've added a few test cases which seem to have run fine.
Let me know what you guys think.