Git Product home page Git Product logo

stylelint-images's Introduction

stylelint-images

NPM version Build Status

A collection of rules to check images for stylelint (in a form of a plugin).

Table of Contents

Installation

stylelint-images is a plugin for stylelint, so it's meant to be used with it.

Node.js v6 or newer is required. That's because stylelint itself doesn't support Node.js versions below 6.

First, install stylelint-images (and stylelint, if you haven't done so yet) via NPM:

npm install -D stylelint@^9.1.0 stylelint-images

Or if you use Yarn:

yarn add stylelint@^9.1.0 stylelint-images -D

Usage

Create the .stylelintrc.json config file (or open the existing one), add stylelint-images to the plugins array and the rules you need to the rules list. All rules from stylelint-images need to be namespaced with images.

{
  "plugins": [
    "stylelint-images"
  ],
  "rules": {
    "images/broken": true,
    "images/prefer-data-uri": 256,
    ...
  }
}

Please refer to stylelint docs for the detailed info on using this linter.

List of rules

  • broken: Checks if the images are broken.
  • prefer-data-uri: Suggest using data-URIs instead of an external image if its file size (in bytes) is smaller than the limit.

Contribute

Feel free to dive in! Open an issue or submit PRs.

stylelint-images follows the Contributor Covenant Code of Conduct.

License

stylelint-images is MIT licensed.

stylelint-images's People

Contributors

ramasilveyra avatar pkuczynski avatar ntwb avatar

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.