Skip to content

Replace deprecated sass-lint for stylelint #12774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jan 6, 2023

Conversation

miketheman
Copy link
Member

sass-lint has been deprecated since 2017, here's what's on their README:

Screenshot 2023-01-06 at 1 50 02 PM

I appreciate they are trying to get their message across. Out with the old, in with the new!

Stylelint started in 2014, and has become a common utility for Sass authors.

The resulting config rules is an attempt to preserve current structure and minimize changes,

See commits for specific changes to make review easier.

Resolves some open vulnerability reports. Results in npm audit from:

30 vulnerabilities (1 low, 14 moderate, 14 high, 1 critical)

to:

18 vulnerabilities (1 low, 9 moderate, 8 high)

Note: I attempted to also add the https://www.npmjs.com/package/stylelint-itcss package, but our ITCSS structure is not 100% standard, and raised a fair amount of linter issues on its own, so I'll leave that off for another time.

Trying to match the existing `.sass-lint.yml` rules as much as we can.

Signed-off-by: Mike Fiedler <[email protected]>
Fixed based on the stylelint rules.

There's 65 remaining fixes if we choose to change enable:
- at-rule-empty-line-before
- declaration-empty-line-before

Signed-off-by: Mike Fiedler <[email protected]>
With `selector-pseudo-element-colon-notation` enabled, we double-colon
pseudo selectors for visual specificity.

Signed-off-by: Mike Fiedler <[email protected]>
Signed-off-by: Mike Fiedler <[email protected]>
Solves:

- alpha-value-notation: 5
- color-function-notation: 5
- color-hex-case: 3
- color-hex-length: 1

Signed-off-by: Mike Fiedler <[email protected]>
- declaration-block-trailing-semicolon: 2
- font-family-name-quotes: 1
- length-zero-no-unit: 1
- number-leading-zero: 1
- property-no-vendor-prefix: 1
- value-keyword-case: 1

Signed-off-by: Mike Fiedler <[email protected]>
Introduced in pypi#3397

Raises lint error for `no-duplicate-selectors`.

- Remove duplication
- Disable lint rule for the Pygments block, since it helps us visually
  organize our thoughts.

Signed-off-by: Mike Fiedler <[email protected]>
Instead of trying to decipher in the future how I came up with the
selector pattern, use a plugin that implements the right selector
syntaxes.

We disable the inherited `selector-class-pattern` rule from
`stylelint-config-standard`.

Refs: stylelint/stylelint-config-standard#209

Signed-off-by: Mike Fiedler <[email protected]>
@miketheman miketheman requested a review from a team as a code owner January 6, 2023 19:01
@miketheman miketheman added CSS/SCSS requires change to CSS/SCSS files dependencies Pull requests that update a dependency file labels Jan 6, 2023
@miketheman miketheman mentioned this pull request Jan 6, 2023
13 tasks
@di di merged commit 6e3ed16 into pypi:main Jan 6, 2023
@@ -183,7 +183,7 @@
}

@media only screen and (max-width: $tablet) {
margin: 25px 10px 10px 10px;
margin: 25px 10px 10px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kinda gross that the new once prefers this way less obvious three value version just cause r/l are same margin, but OK

@@ -55,16 +55,6 @@

// Remove top margin on elements at the top of the description
> div:first-child > *:first-child,
> *:first-child,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand this... do we know why it was repeated before?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Originated during this change: a5be8a7

$dark-blue: darken($primary-color, 10);
$darkest-blue: darken($primary-color, 20);
$green: darken($success-color, 5);
$light-green: $success-color;
$red: $danger-color;
$dark-red: darken($danger-color, 20);
$purple: #bb0066;
$orange: #A36200;
$purple: #b06;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a rule to prefer "long" hex codes? this seems unnecessarily golfy.

@miketheman miketheman deleted the miketheman/replace-sass-lint branch January 6, 2023 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS/SCSS requires change to CSS/SCSS files dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants