Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
stylelint-scss
Advanced tools
The stylelint-scss npm package is a plugin for stylelint that provides linting rules specific to SCSS syntax. It helps enforce consistent conventions and avoid errors in your SCSS files.
Linting SCSS-specific syntax
This feature allows you to lint SCSS-specific syntax such as @rules, $variables, and nesting. The code sample shows how to enable rules in a stylelint configuration file to disallow unknown @rules, enforce a naming pattern for $variables, and prevent redundant nesting selectors.
"rules": {
"scss/at-rule-no-unknown": true,
"scss/dollar-variable-pattern": "^foo-",
"scss/selector-no-redundant-nesting-selector": true
}
Enforcing best practices
This feature helps enforce best practices in SCSS by preventing common mistakes. The code sample demonstrates enabling rules that ensure placeholders are used with @extend, discourage the use of leading underscores in partial names on @import, and prevent duplicate $variable declarations.
"rules": {
"scss/at-extend-no-missing-placeholder": true,
"scss/at-import-no-partial-leading-underscore": true,
"scss/no-duplicate-dollar-variables": true
}
Customizable rules for SCSS
This feature provides customizable rules tailored for SCSS, allowing you to enforce specific stylistic decisions or prevent certain patterns. The code sample shows rules that enforce no spaces around operators, disallow nested properties, and ensure that dimensions only contain numeric values.
"rules": {
"scss/operator-no-unspaced": true,
"scss/declaration-nested-properties": "never",
"scss/dimension-no-non-numeric-values": true
}
sass-lint is a Node-only Sass linter for both sass and scss syntax. It offers similar functionality to stylelint-scss but is not a plugin for stylelint and has its own set of rules and configuration.
postcss-scss is a SCSS parser for PostCSS, which allows you to lint SCSS within PostCSS's ecosystem. It can be used with stylelint but does not provide SCSS-specific linting rules on its own.
scss-lint is a Ruby gem that provides linting for SCSS files. It is similar to stylelint-scss in that it focuses on SCSS syntax but requires Ruby and is not integrated with the stylelint ecosystem.
Specify a pattern for Sass/SCSS-like mixin names.
@mixin complex-object ($items: 10) {
/** ↑
* The pattern of this */
regex
or string
A string will be translated into a RegExp like so new RegExp(yourString)
— so be sure to escape properly.
/foo-.+/
The following patterns are considered warnings:
@mixin boo-bar {
The following patterns are not considered warnings:
@mixin foo-bar {
1.2.0
partial-no-import
rule.media-feature-value-dollar-variable
rule.at-import-partial-extension-blacklist
rule.at-import-partial-extension-whitelist
rule.at-import-no-partial-extension
rule.dollar-variable-no-missing-interpolation
was throwing an error on older Node.js versions.FAQs
A collection of SCSS-specific rules for Stylelint
The npm package stylelint-scss receives a total of 2,340,666 weekly downloads. As such, stylelint-scss popularity was classified as popular.
We found that stylelint-scss demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.