Add "no dirty" core rules
jedrichards opened this issue · 0 comments
jedrichards commented
"No dirty" rules would check for layer styles that have diverged from their associated shared style.
Two new rules could implement this behaviour:
text-styles-no-dirty
layer-styles-no-dirty
Inspiration for these rules comes from this community plugin https://github.com/KevinGutowski/FindDirtyStyles
Approach
I haven't thought through the approach fully yet but it's likely to involve:
- For each layer/text style in the document
- If it has an associated shared style
- Compare the layer style with the shared style, and if they're different raise a violation (when comparing styles a possible approach is to compare their hash like we're already doing here)
- If it has an associated shared style