Socket
Socket
Sign inDemoInstall

stylelint-processor-styled-components

Package Overview
Dependencies
Maintainers
4
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylelint-processor-styled-components

A stylelint processor for styled-components


Version published
Weekly downloads
285K
increased by2.23%
Maintainers
4
Weekly downloads
 
Created

What is stylelint-processor-styled-components?

The stylelint-processor-styled-components package is a plugin for Stylelint that allows you to lint styled-components in your JavaScript and TypeScript files. It helps ensure that your styled-components adhere to your project's style guidelines.

What are stylelint-processor-styled-components's main functionalities?

Linting styled-components

This feature allows you to lint styled-components within your JavaScript or TypeScript files. The code sample shows a styled-component definition and a Stylelint configuration that uses the stylelint-processor-styled-components processor.

/* Example of a styled-component */
import styled from 'styled-components';

const Button = styled.button`
  background: blue;
  color: white;
  font-size: 16px;
`;

/* Stylelint configuration */
module.exports = {
  processors: ['stylelint-processor-styled-components'],
  extends: ['stylelint-config-standard'],
  rules: {
    'color-no-invalid-hex': true,
    'font-family-no-duplicate-names': true
  }
};

Custom rules for styled-components

This feature allows you to define custom Stylelint rules specifically for styled-components. The code sample shows a styled-component and a Stylelint configuration with custom rules such as 'block-no-empty' and 'unit-whitelist'.

/* Example of a styled-component with custom rules */
import styled from 'styled-components';

const Container = styled.div`
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
`;

/* Stylelint configuration with custom rules */
module.exports = {
  processors: ['stylelint-processor-styled-components'],
  extends: ['stylelint-config-standard'],
  rules: {
    'block-no-empty': true,
    'unit-whitelist': ['em', 'rem', '%', 's']
  }
};

Other packages similar to stylelint-processor-styled-components

Keywords

FAQs

Package last updated on 14 Feb 2020

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc