Introduce scss linting to codebase #3703
Open
+953
−24
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.
Description
Disclaimer: this PR is purely the result of the fact i was experimenting with tooling and needed a larger codebase to do so.
In here I add stylelint which allows you to spot issues in your scss such as duplicate selectors, prefixes that shouldn't be there because of tools like autoprefixer and many others. Each issue comes with a rule name which has some solid reasoning behind it on their website.
Judging by the current output it needs fine tuning to adjust to the code-base conventions such as selector-case since there's a lot of classes with camel case. But given scss conventions maintainers might elect to conform to the recommended rules.
Perhaps the coolest part of this PR though: The formatter on the lint:scss:ci script makes GitHub highlight all errors directly in the code so you get something akin to an automatic code review. So if you enable GitHub actions on my PR you will see every error raised without having to run it locally
From the 1800 issues about 800 are auto-fixable, I did not do that in this PR because I do not know this code-base nearly well enough to do so confidently but if I receive approval I will gladly fix all the issues mentioned by the linter
Issues Resolved
List any existing issues this PR resolves
Check List