Giter Club home page Giter Club logo

stylelint-browser-compat's Introduction

stylelint-browser-compat

stylelint-browser-compat

github sponsors 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

stylelint-browser-compat's People

Contributors

3846masa avatar renovate[bot] avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

stylelint-browser-compat's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Repository problems

These problems occurred while renovating this repository. View logs.

  • WARN: Use matchDepNames instead of matchPackageNames

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(npm): update dependency rimraf to v5.0.7

Pending Status Checks

These updates await pending status checks. To force their creation now, click the checkbox below.

  • chore(npm): update pnpm to v9.1.1

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/default.yml
  • actions/checkout v4.1.5@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
  • pnpm/action-setup v4.0.0@fe02b34f77f8bc703788d5817da081398fad5dd2
  • actions/setup-node v4.0.2@60edb5dd545a775178f52524783378180af0d1f8
  • actions/checkout v4.1.5@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
  • pnpm/action-setup v4.0.0@fe02b34f77f8bc703788d5817da081398fad5dd2
  • actions/setup-node v4.0.2@60edb5dd545a775178f52524783378180af0d1f8
  • actions/github-script v7.0.1@60a0d83039c74a4aee543508d2ffcb1c3799cdea
  • actions/checkout v4.1.5@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
  • pnpm/action-setup v4.0.0@fe02b34f77f8bc703788d5817da081398fad5dd2
  • actions/setup-node v4.0.2@60edb5dd545a775178f52524783378180af0d1f8
.github/workflows/stale.yml
  • actions/stale v9.0.0@28ca1036281a5e5922ead5184a1bbf96e5fc984e
nodenv
.node-version
  • node 18.20.2
npm
package.json
  • @mdn/browser-compat-data 5.5.23
  • array.prototype.at 1.1.3
  • lodash.get 4.4.2
  • postcss-media-query-parser 0.2.3
  • postcss-selector-parser 6.0.16
  • postcss-value-parser 4.2.0
  • semver 7.6.2
  • string.prototype.at 1.0.6
  • ts-results 3.3.0
  • zod 3.23.8
  • @3846masa/configs c2529a905cc60d13b110fb1f4cab5ca4486da4ac
  • @babel/cli 7.24.5
  • @babel/core 7.24.5
  • @babel/preset-env 7.24.5
  • @babel/preset-typescript 7.24.1
  • @semantic-release/changelog 6.0.3
  • @semantic-release/commit-analyzer 9.0.2
  • @semantic-release/exec 6.0.3
  • @semantic-release/git 10.0.1
  • @semantic-release/npm 9.0.2
  • @semantic-release/release-notes-generator 10.0.3
  • @types/common-tags 1.8.4
  • @types/eslint 8.56.10
  • @types/fs-extra 11.0.4
  • @types/lodash.get 4.4.9
  • @types/semver 7.5.8
  • babel-jest 29.7.0
  • babel-plugin-module-resolver 5.0.2
  • babel-plugin-polyfill-es-shims 0.10.5
  • browserslist 4.23.0
  • common-tags 1.8.2
  • fs-extra 11.2.0
  • jest 29.7.0
  • jest-light-runner 0.6.0
  • jest-preset-stylelint 7.0.0
  • postcss 8.4.38
  • rimraf 5.0.6
  • semantic-release 19.0.5
  • stylelint 16.5.0
  • typescript 5.4.5
  • pnpm 9.1.0

  • Check this box to trigger a request for Renovate to run again on this repository

The automated release is failing 🚨

🚨 The automated release from the develop branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the develop branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two Factor Authentication for your account, set its level to "Authorization only" in your account settings. semantic-release cannot publish with the default "
Authorization and writes" level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.