Yet another linter rule to detect compatibility of CSS features.

Overview

stylelint-browser-compat

stylelint-browser-compat

npm license standard-readme compliant

Yet another linter rule to detect compatibility of CSS features.

This plugin checks if the CSS you're using is supported by the browsers you're targeting. It uses @mdn/browser-compat-data to detect browser support.

โš ๏ธ This plugin is beta. USE AT YOUR OWN RISK.

Table of Contents

Background

stylelint-no-unsupported-browser-features (using doiuse) is available to detect compatibility of CSS features.

However, doiuse have not been maintained for a long time.

This library provides another alternative to detect compatibility of CSS features.

Although doiuse detects compatibility from caniuse data, this library uses @mdn/browser-compat-data to do so.

Install

$ npm install --dev browserslist stylelint stylelint-browser-compat
$ yarn add --dev browserslist stylelint stylelint-browser-compat

Usage

module.exports = {
  plugins: ['stylelint-browser-compat'],
  rules: {
    'plugin/browser-compat': [
      true,
      {
        allow: {
          features: ['at-rules.supports'],
          flagged: false,
          partialImplementation: false,
          prefix: true,
        },
        browserslist: ['last 2 versions'],
      },
    ],
  },
};

Options

  • browserslist (string or array, optional)
    • Accepts browserslist queries for target browsers.
    • By default, browserslist automatically loads the configuration file (e.g. package.json, .browserslistrc).
  • allow.features (array, optional)
    • Accepts an array of features to allow.
    • Feature names are from @mdn/browser-compat-data.
      • For example, if you want to use @supports at-rules, pass at-rules.supports.
  • allow.flagged (boolean, optional)
    • Allows features that are available when the browser's feature flags is enabled.
    • false by default
  • allow.partialImplementation (boolean, optional)
    • Allows features that are partial implementations.
    • false by default
  • allow.prefix (boolean, optional)
    • Allows features with vendor prefix.
    • true by default

Contributing

PRs accepted.

License

MIT (c) 3846masa

Comments
Releases(v1.0.0-beta.30)
Owner
Masahiro Miyashiro (3846masa)
Web Developer
Masahiro Miyashiro (3846masa)
Proof of concept: support immutable trpc servers using lambdas to ensure client/server compatibility

auto-versioned-trpc-aws-lambda Proof of concept to support an automatically versioned AWS Lambda running tRPC to ensure a somewhat graceful and automa

Kenneth Skovhus 5 Aug 30, 2022
Yet another eslint blame (might) with better adaptability

yet-another-eslint-blame Yet another eslint blame (might) with better adaptability. The input is eslint's output with json format (You can see it here

ๅฟซๆ‰‹โ€œๆŽข็ดข็ป„โ€ๅ‰็ซฏ 5 Mar 7, 2022
Yet another basic minter.

Mojito Yet another basic minter. Live demo: https://mojito-app.netlify.app/ Motivation The create-eth-app team recently added useDApp in their v1.8.0,

Julien Bรฉranger 3 Apr 26, 2022
Yet another library for generating NFT artwork, uploading NFT assets and metadata to IPFS, deploying NFT smart contracts, and minting NFT collections

eznft Yet another library for generating NFT artwork, uploading NFT assets and metadata to IPFS, deploying NFT smart contracts, and minting NFT collec

null 3 Sep 21, 2022
โ˜ Yet Another Cloud Notepad.

โ˜ Serverless Cloud Notepad English | ็ฎ€ไฝ“ไธญๆ–‡ Build for recording text or sharing between friends. Powerby Cloudflare Workers, easy to deploy privately. โœจ

ๅ†‡ 35 Oct 29, 2022
Yet Another Clickhouse Client for Node.js

yacc-node - Yet Another Clickhouse Client for NodeJS Introduction yacc-node is a zero depencies Clickhouse Client written in Typescript. Installation

Antonio Vizuete 3 Nov 3, 2022
yet another 2048, but this time it's controlled by GPT

2048 About a few years ago, I built 2048.wasm This is yet another 2048 from me, but this time it's controlled by GPT. Demo 2048-short.mov How GPT crus

Nishchith Shetty 43 Jul 17, 2023
zieeco 12 Jul 8, 2022
The one DAO to rule them all. A modular DAO written in Clarity for the Stacks blockchain.

ExecutorDAO The one DAO to rule them all. ExecutorDAO is designed to be completely modular and flexible, leveraging Clarity to the fullest extent. The

Marvin 31 Oct 5, 2022
๐Ÿคช A linter, prettier, and test suite that does everything as-simple-as-possible.

Features Fully Featured Code Grading Knowing if you need to work on your code is important- that's why we grade your code automatically. But, unlike o

Fairfield Programming Association 18 Sep 25, 2022
All-in-one code linter and formatter for TypeScript and JavaScript

Uniform is a CLI tool - code linter and formatter for JavaScript and TypeScript. Works using eslint and prettier under the hood.

Irakli Dautashvili 21 Feb 27, 2022
This textlint rule found representations not suitable for English papers

This textlint rule found representations not suitable for English papers

SATO Yusuke 4 Mar 1, 2022
Linter for Nix using tree-sitter ๐ŸŒณ + โ„๏ธ

Linter for Nix using tree-sitter ?? + โ„๏ธ This is a simple linter for Nix that uses tree-sitter. I plan on extending it with more detections in the fut

Ben Siraphob 41 Dec 20, 2022
Implementation of Googleโ€™s One Version Rule for JS monorepos

@wayfair/one-version One Version to rule them all, One Version to find them, One Version to bring them all, and in the darkness bind them.1 Opinionate

Wayfair Tech 17 Nov 9, 2022
Validate your Markdown frontmatter data against a JSON schema โ€” remark-lint rule plugin

remark-lint-frontmatter-schema Validate Markdown frontmatter YAML against an associated JSON schema with this remark-lint rule plugin. Supports: Types

Julian Cataldo 20 Dec 10, 2022
Awesome book with ES6, this project is build using HTML,CSS, JavaScript ES6 the project allows you to add books and save them with the author , for another time checks

Project Name Awsome books Description the project. adding books daynamiclly Built With Major languages Frameworks Technologies used Live Demo (if avai

Alzubair Alqaraghuli 5 Jul 25, 2022
Another CSS style library, used for my personal branding and to make websites prettier!

furret.css My personal website styling toolkit, modeled after the lovely Water.css by Kognise. Written to allow quick and beautiful styling for simple

Ray 14 Dec 23, 2022
Simple yet powerful to-do list app to manage your daily tasks! Built with: CSS, HTML, JavaScript

To-Do List Simple yet powerful to-do app to manage your daily tasks! Built With HTML, CSS Fameworks: N/A Technologies: Linters, Git, GitHub, Webpack L

Amaury Permer 7 Jul 21, 2022