Socket
Socket
Sign inDemoInstall

stylelint-no-unsupported-browser-features

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylelint-no-unsupported-browser-features

Disallow features that are unsupported by the browsers that you are targeting


Version published
Weekly downloads
202K
decreased by-5.11%
Maintainers
1
Weekly downloads
 
Created

What is stylelint-no-unsupported-browser-features?

The stylelint-no-unsupported-browser-features package is a plugin for Stylelint that helps developers avoid using CSS features that are not supported by the browsers they are targeting. It leverages the data from caniuse.com to provide warnings or errors when unsupported features are detected in the CSS code.

What are stylelint-no-unsupported-browser-features's main functionalities?

Detect unsupported CSS features

This feature allows you to configure the plugin to detect unsupported CSS features based on the specified browser targets. The configuration in the code sample sets the plugin to warn about unsupported features for browsers with more than 1% market share, the last two versions of all browsers, and Firefox ESR.

module.exports = {
  plugins: [
    'stylelint-no-unsupported-browser-features'
  ],
  rules: {
    'plugin/no-unsupported-browser-features': [true, {
      browsers: ['> 1%', 'last 2 versions', 'Firefox ESR'],
      severity: 'warning'
    }]
  }
};

Customizing the severity of warnings

This feature allows you to customize the severity of the warnings or errors generated by the plugin. In this example, the severity is set to 'error', which will cause the build to fail if unsupported features are detected.

module.exports = {
  plugins: [
    'stylelint-no-unsupported-browser-features'
  ],
  rules: {
    'plugin/no-unsupported-browser-features': [true, {
      browsers: ['> 1%', 'last 2 versions'],
      severity: 'error'
    }]
  }
};

Ignoring specific features

This feature allows you to ignore specific CSS features that you do not want the plugin to check for. In this example, the plugin is configured to ignore warnings for CSS Grid and CSS Variables.

module.exports = {
  plugins: [
    'stylelint-no-unsupported-browser-features'
  ],
  rules: {
    'plugin/no-unsupported-browser-features': [true, {
      browsers: ['> 1%', 'last 2 versions'],
      ignore: ['css-grid', 'css-variables']
    }]
  }
};

Other packages similar to stylelint-no-unsupported-browser-features

Keywords

FAQs

Package last updated on 25 Jan 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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc