Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add `stylelint` and scss configs - see https://github.com/stylelint/stylelint/blob/main/docs/user-guide/get-started.md#using-a-community-shared-config - note that adding postcss@8 is necessary for the scss config to work - see stylelint-scss/stylelint-config-standard-scss#5 * Convert `.stylelintrc` to `.stylelintrc.js` + add scss configs - JS file helps us do things like leave meaningful comments, which JSON doesn't allow * Update ignored files - previously ignored files were added due to vscode's overeager linting - it looks like said plugin no longer does so, so we can remove non `.scss` files - port over sass-lint excludes - add missed datepicker dir - add non-src files - remove no-longer-existant chart dir * Remove sass-lint, swap over yarn shortcuts * Convert camelCase name linting * Convert indentation lint rule + fix issues caught by stylelint but not by sass-lint - unlike sass-lint, stylelint checks indentation of comments and also checks for tabs vs spaces + fix a few unnecessary `()`s, and add a disable because stylelint is confused by scss maps + remove unnecessary indentation disables * Convert single quotes lint rule + add skip for Sass scenarios where `"` has to be used for interpolation * Convert brace style lint rule - there isn't a handy `1tbs` option like eslint/sass-lint, so we need to combine a few different rules to get the effecrt we want + fix various instances where stylelint caught unnecessary double spaces before braces * Convert various value lint preferences + include some rules that stylelint is more strict about than sass-lint was * Fix pseudo-element lint rule - sass-lint was incorrectly marking pseudo *classes* as needing two `::`, whereas only pseudo *elements* need two `::`s. stylelint appears to correctly catch this OOTB @see https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Pseudo-classes_and_pseudo-elements * Convert newline between rulesets/blocks lint rule * [opinionated] Add several new lint rules catching extra newlines/whitespace - prettier does the same/similar for JS/CSS-in-JS in any case * Add lint rule for 1 selector per line - already appears to be something we do or was enforced by sass-lint, but stylelint needs the explicit rule * Convert/fix rules around syntax whitespaces * [opinionated] Fix several comment rules stylelint ships with OOTB - specifically around empty comments & spacing around comments - I find them to be valid and inline with JS linting * Fix `no-duplicate-selectors` caught by stylelint (but not sass-lint) * Override default stylelint rules for backwards-compatability - without these added rules, we get stylelint errors for how we currently write our CSS - although we may want to consider removing these in the future & using more modern syntax * Fix vendor prefix linting by converting to stylelint-disable syntax * Disable various opinionated stylelist defaults - that were not previous enforced by sass-lint - we can consider turning them on at a later time if we want * Convert no `!important` rule and overrides + remove unnecessary disables * Convert nesting depth rule - default with sass-lint but not with stylelint or existing configs + remove unnecessary disables + add newly necessary disables (some it's unclear why sass-lint didn't catch, and some are due to sass syntax, which stylelint unfortunately does not care about) * Convert Sass empty ruleset lint rule - by default, stylelint considers comments to not make the block empty * Convert qualifying elements selector lint rule * Clarify function name lint rule + remove disables * Attempt to convert - this is not perfect - stylelint does not appear to have a 1:1 with sass-lint on this, but it's somewhat close and will become less of an issue as we migrate to Emotion + remove disable lines that no longer apply * Remove unnecessary sass lint disables - no-mispelled-properties is simply wrong / out of date - no-warn was already disabled in -sass-lint.yml - empty-args isn't useful in a post-sass world * 🚫 Remove mixin order rule - there's no corresponding stylelint rule, and it feels pedantic / not terribly useful * 🚫 Remove border 0 rule - there's no corresponding stylelint rule, and it feels pedantic / not useful * Remove all remaining disabled sass-lint rules - these don't appear to be enforced by stylelint, and as such nothing needs to be done * Delete all sass lint config files * Add some more stylelint docs links & notes * Remove `prettier-stylelint` - It's not clear to me why that plugin was added or what it does, and it was last updated 5 years ago and uses a super old version of stylelint (8.x), so I'm removing it * [PR feedback] Remove `number-leading-zero` rule - thanks Elizabet!
- Loading branch information