-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(frontend): Add stylelint (#18627)
* test(frontend): Add stylelint * Remove ordering from the first step * Further specify a few rules * Fix a bunch of simple issues * Add stylelint to pre-commit hooks and CI * Remove orphaned package-lock.json * Update UI snapshots for `webkit` (2) * Update UI snapshots for `webkit` (2) * Retain `currentColor` * Revert media queries change, and enforce modern colors * Add TODOs to the config * Fix a few more colors --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
390f6c7
commit 74c0309
Showing
151 changed files
with
1,538 additions
and
506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
frontend/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
module.exports = { | ||
extends: 'stylelint-config-standard-scss', // TODO: Enable separately, as the diff will be significant | ||
// TODO: Enable separately, as the diff will be significant "plugins": ["stylelint-order"], | ||
rules: { | ||
'no-descending-specificity': null, | ||
'number-max-precision': 5, | ||
'value-keyword-case': [ | ||
'lower', | ||
{ | ||
// CSS Color Module Level 3 says currentColor, Level 4 candidate says currentcolor | ||
// Sticking to Level 3 for now | ||
camelCaseSvgKeywords: true, | ||
}, | ||
], | ||
// Sadly Safari only started supporting the range syntax of media queries in 2023, so let's switch to that | ||
// ('context' value) in 2024, once support is better https://caniuse.com/?search=range%20context | ||
'media-feature-range-notation': 'prefix', | ||
'selector-class-pattern': [ | ||
'^[A-Za-z0-9_-]+(__[A-Za-z0-9_-]+)?(--[A-Za-z0-9-]+)?$', | ||
{ | ||
message: 'Expected class selector to match Block__Element--Modifier or plain snake-case', | ||
}, | ||
], | ||
'selector-id-pattern': [ | ||
'^[A-Za-z0-9_-]+(__[A-Za-z0-9_-]+)?(--[A-Za-z0-9_-]+)?$', | ||
{ | ||
message: 'Expected id selector to match Block__Element--Modifier or plain kebak-case', | ||
}, | ||
], | ||
'keyframes-name-pattern': [ | ||
'^[A-Za-z0-9_-]+__[A-Za-z0-9_-]+$', | ||
{ | ||
message: 'Expected keyframe name to match Block__Animation', | ||
}, | ||
], | ||
'scss/dollar-variable-pattern': [ | ||
'^[A-Za-z_]+[A-Za-z0-9_-]+$', | ||
{ | ||
message: 'Expected variable to match kebab-case or snake_case', | ||
}, | ||
], | ||
'scss/operator-no-newline-after': null, // Doesn't always play well with prettier | ||
'scss/at-extend-no-missing-placeholder': null, | ||
'scss/comment-no-empty': null, | ||
// "order/order": ["dollar-variables", "custom-properties", "declarations", "rules", "at-rules"], | ||
// "order/properties-order": ["width", "height"], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.