Socket
Socket
Sign inDemoInstall

@vtex/shoreline-stylelint

Package Overview
Dependencies
0
Maintainers
0
Versions
104
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vtex/shoreline-stylelint


Version published
Maintainers
0
Created

Readme

Source

Shoreline Stylelint

A configuration of Stylelint rules to help with the Shoreline adoption.

How to run?

All files:

pnpm stylelint **/*.css

Specific file:

pnpm run stylelint src/example.css

Fix:

pnpm stylelint **/*.css --fix

Development

Add new rules

  1. Refer to the Writing rules guide of the Stylelint documentation

Build custom rules

  1. Refer to the Writing plugins guide of the Stylelint documentation
  2. Create your rule in the /src/plugins directory
  3. Validate your plugin with tests (reference sibling plugins for examples)

Useful references:

  1. PostCSS API: It is useful when writing a new plugin.
  2. jest-preset-stylelint: Use this documentation when writing tests.
  3. stylelint-prettier

Setup new rule or plugin

You must set the new rule or plugin on the Stylelint configuration file

Rules

no-px-values

This rule prevents your CSS properties from having a px value defined.

/* Don't 🚫 */
margin: 4px;
padding-bottom: 8px;
padding-top: 8px;
height: 24px;

/* Do ✅ */
margin: 0.25rem;
padding-bottom: 0.5rem;
padding-top: 0.5rem;
height: 1.5rem;

Using the --fix command will convert the px values to rem.

no-text-property

/* Don't 🚫 */
text: var(--sl-text-caption-2);

/* Do ✅ */
font: var(--sl-text-caption-2-font);
letter-spacing: var(--sl-text-caption-2-letter-spacing);

Using the --fix command will split the text property into font and letter-spacing.

FAQs

Last updated on 10 Jul 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc