Gathering detailed insights and metrics for stylelint-no-unsupported-browser-features
Gathering detailed insights and metrics for stylelint-no-unsupported-browser-features
Gathering detailed insights and metrics for stylelint-no-unsupported-browser-features
Gathering detailed insights and metrics for stylelint-no-unsupported-browser-features
Disallow features that aren't supported by your target browser audience.
npm install stylelint-no-unsupported-browser-features
Typescript
Module System
Min. Node Version
Node Version
NPM Version
82.6
Supply Chain
94.1
Quality
75.1
Maintenance
100
Vulnerability
98.9
License
JavaScript (100%)
Total Downloads
39,914,954
Last Day
18,506
Last Week
263,248
Last Month
1,207,814
Last Year
12,372,050
436 Stars
261 Commits
20 Forks
8 Watchers
4 Branches
14 Contributors
Updated on Jun 27, 2025
Latest Version
8.0.4
Package Id
stylelint-no-unsupported-browser-features@8.0.4
Unpacked Size
10.22 kB
Size
3.76 kB
File Count
3
NPM Version
10.8.2
Node Version
20.18.1
Published on
Jan 28, 2025
Cumulative downloads
Total Downloads
Last Day
-9%
18,506
Compared to previous day
Last Week
-9.4%
263,248
Compared to previous week
Last Month
1.7%
1,207,814
Compared to previous month
Last Year
34.2%
12,372,050
Compared to previous year
1
21
disallow features that aren't supported by your target browser audience
This plugin checks if the CSS you're using is supported by the browsers you're targeting. It uses doiuse to detect browser support. Doiuse itself checks your code against the caniuse database and uses browserslist to get the list of browsers you want to support. Doiuse and this plugin are only compatible with standard css syntax, so syntaxes like scss
, less
and others aren't supported.
1$ npm install stylelint-no-unsupported-browser-features
Stylelint is a peerdependency of this plugin, so you'll have to install stylelint as well:
1$ npm install stylelint
"stylelint-no-unsupported-browser-features"
to your stylelint config plugins array"plugin/no-unsupported-browser-features"
to your stylelint config rulestrue
, or pass optional extra configurationbrowsers
: optional. Accepts an array of browsers you want to support. For example ['> 1%', 'Last 2 versions']
. See browserslist for documentation.ignore
: optional. Accepts an array of features to ignore. For example: ['rem', 'css-table']
. Feature names can be found in the error messages.ignorePartialSupport
: optional, off by default. Accepts a boolean. When enabled:
So for example, in a .stylelintrc
:
1{ 2 "plugins": ["stylelint-no-unsupported-browser-features"], 3 "rules": { 4 "plugin/no-unsupported-browser-features": [ 5 true, 6 { 7 "browsers": ["> 1%", "Last 2 versions"], 8 "ignore": ["rem"], 9 "ignorePartialSupport": true 10 } 11 ] 12 } 13}
This is a good rule to use with "warning"-level severity, because its primary purpose is to warn you that you are using features not all browsers fully support and therefore ought to provide fallbacks. But the warning will continue even if you have a fallback in place (it doesn't know); so you probably do not want this rule to break your build. Instead, consider it a friendly reminder to double-check certain spots for fallbacks.
Also, doiuse uses browserslist to get the list of browsers you want to support. Browserslist accepts a browserslist
file at the root of your project with a list of browsers that you want to support. Since there are other projects that can use this file (like autoprefixer or eslint-plugin-compat) the simplest solution is to define your intended browser support in this file. There are a lot of different ways to define this list. Check out the browserslist documentation for more options.
For the above setup you could use the following config:
./.stylelintrc
1{ 2 "plugins": ["stylelint-no-unsupported-browser-features"], 3 "rules": { 4 "plugin/no-unsupported-browser-features": [ 5 true, 6 { 7 "severity": "warning" 8 } 9 ] 10 } 11}
./browserslist
:
1> 5% 2Last 2 versions
browsers
property within the rules section of .stylelintrc
you can ignore this issue. Changes to the browsers
property are discovered immediately.MIT
No vulnerabilities found.
No security vulnerabilities found.