Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
stylelint
Advanced tools
A mighty CSS linter that helps you avoid errors and enforce conventions.
Stylelint is a powerful, modern linter that helps you avoid errors and enforce consistent conventions in your stylesheets. It is configurable and supports the latest CSS syntax as well as CSS-like syntaxes, such as SCSS.
Linting CSS files
This command will lint all CSS files in the 'src' directory and its subdirectories. It will check for errors and code quality issues based on the rules defined in the configuration.
"stylelint 'src/**/*.css'"
Fixing CSS files
This command will not only lint the CSS files but also attempt to fix any fixable issues, such as formatting inconsistencies, automatically.
"stylelint 'src/**/*.css' --fix"
Custom configuration
This JSON represents a custom Stylelint configuration object where specific rules are defined, such as disallowing invalid hex colors, setting indentation preferences, and enforcing no leading zero for numbers.
{ "rules": { "color-no-invalid-hex": true, "indentation": [2, { "except": ["block"] }], "number-leading-zero": "never" } }
Extending configurations
This JSON represents a Stylelint configuration that extends a shared configuration, in this case, 'stylelint-config-standard', which is a popular set of rules that enforce common stylistic conventions.
{ "extends": "stylelint-config-standard" }
Using plugins
This JSON represents a Stylelint configuration that includes a plugin, 'stylelint-scss', which adds SCSS-specific linting rules to Stylelint. The configuration then enables a rule from that plugin to disallow unknown at-rules in SCSS.
{ "plugins": ["stylelint-scss"], "rules": { "scss/at-rule-no-unknown": true } }
ESLint is a static code analysis tool for identifying problematic patterns in JavaScript code. It is similar to Stylelint in its extensibility and plugin ecosystem but is focused on JavaScript rather than stylesheets.
Prettier is an opinionated code formatter that supports many languages, including CSS. Unlike Stylelint, which can both lint and fix code, Prettier is solely focused on code formatting and does not provide linting functionalities.
Sass-lint is a node-only Sass linter for both sass and scss syntax. It is similar to Stylelint when working with SCSS files but does not support plain CSS or other CSS-like syntaxes.
CSSLint is a tool that helps to point out problems with your CSS code. It is less configurable than Stylelint and has a smaller set of rules and plugins, but it serves a similar purpose in linting CSS files.
A mighty CSS linter that helps you avoid errors and enforce conventions.
It's mighty as it:
And it can be extended to:
It'll help you avoid errors, for example:
And enforce conventions, for example:
We recommend using a pretty printer like Prettier alongside Stylelint. Linters and pretty printers are complementary tools that work together to help you write consistent and error-free code.
Stylelint is maintained by volunteers. Without the code contributions from all these fantastic people, Stylelint would not exist. Become a contributor.
We'd like to thank all past members for their invaluable contributions, including two of Stylelint's co-creators @davidtheclark and @MoOx.
Thank you to all our sponsors! Become a sponsor.
Thank you to all our backers! Become a backer.
16.11.0
--report-unscoped-disables
CLI flag and reportUnscopedDisables
option to Node.js API and configuration object (#8024) (@Mouvedia).ignoreFunctions: []
to media-query-no-invalid
(#8060) (@ryo-manba).name
configuration property under overrides
(#8095) (@ryo-manba).benchmark-rule
script to resolve TypeError
(#8090) (@ybiquitous).github
formatter deprecation warning link to https://stylelint.io/awesome-stylelint#formatters
(#8115) (@ryo-manba).function-calc-no-unspaced-operator
false negatives for calc-size
(#8026) (@azat-io).max-nesting-depth
false positives when the &
selector is being ignored (#8048) (@ryo-manba).media-feature-name-value-no-unknown
false positives for display-mode: picture-in-picture
(#8136) (@Mouvedia).no-irregular-whitespace
reported ranges (#8066) (@romainmenke).selector-attribute-name-disallowed-list
reported ranges (#8037) (@ryo-manba).selector-attribute-operator-allowed-list
reported ranges (#8038) (@ryo-manba).selector-attribute-operator-disallowed-list
reported ranges (#8039) (@ryo-manba).selector-class-pattern
reported ranges (#8042) (@ryo-manba).selector-combinator-allowed-list
reported ranges (#8046) (@ryo-manba).selector-combinator-disallowed-list
reported ranges (#8047) (@ryo-manba).selector-disallowed-list
reported ranges (#8067) (@ryo-manba).selector-id-pattern
reported ranges (#8045) (@ryo-manba).selector-max-attribute
reported ranges (#8052) (@ryo-manba).selector-max-class
reported ranges (#8053) (@ryo-manba).selector-max-combinators
reported-ranges (#8055) (@ryo-manba).selector-max-compound-selectors
reported ranges (#8056) (@ryo-manba).selector-max-id
reported ranges (#8054) (@ryo-manba).selector-max-pseudo-class
reported ranges (#8057) (@ryo-manba).selector-max-specificity
reported ranges (#8058) (@ryo-manba).selector-max-universal
reported ranges (#8059) (@ryo-manba).selector-nested-pattern
reported ranges (#8072) (@ryo-manba).selector-no-vendor-prefix
reported ranges (#8073) (@ryo-manba).selector-not-notation
reported ranges (#8074) (@ryo-manba).selector-pseudo-class-allowed-list
reported ranges (#8061) (@ryo-manba).selector-pseudo-class-disallowed-list
reported ranges (#8062) (@ryo-manba).selector-pseudo-class-no-unknown
reported ranges (#8063) (@ryo-manba).selector-pseudo-element-allowed-list
reported ranges (#8068) (@ryo-manba).selector-pseudo-element-colon-notation
reported ranges (#8069) (@ryo-manba).selector-pseudo-element-disallowed-list
reported ranges (#8070) (@ryo-manba).selector-pseudo-element-no-unknown
false positives for ::scroll-marker
and ::scroll-marker-group
(#8110) (@Mouvedia).selector-pseudo-element-no-unknown
reported ranges (#8071) (@ryo-manba).selector-type-no-unknown
reported ranges (#8076) (@ryo-manba).FAQs
A mighty CSS linter that helps you avoid errors and enforce conventions.
The npm package stylelint receives a total of 4,181,293 weekly downloads. As such, stylelint popularity was classified as popular.
We found that stylelint demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.