Style lint: Disallow shorthand & selectors (#8131)

* Impose and apply rule to prevent shorthand selectors

* Put one back to test the CI

* Put it back to pass CI
This commit is contained in:
Travis Ralston 2022-03-23 12:23:23 -06:00 committed by GitHub
parent 3bb0dc08e8
commit 39a08e1f4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 59 additions and 54 deletions

View file

@ -23,5 +23,10 @@ module.exports = {
// https://github.com/vector-im/element-web/issues/10544
"ignoreAtRules": ["define-mixin"],
}],
// Disable `&_kind`-style selectors while our unused CSS approach is "Find & Replace All"
// rather than a CI thing. Shorthand selectors are harder to detect when searching for a
// class name. This regex is trying to *allow* anything except `&words`, such as `&::before`,
// `&.mx_Class`, etc.
"selector-nested-pattern": "^((&[ :.\\\[,])|([^&]))"
}
}