Nigerian Prince Meme

    stylelint-unused-classes

    0.1.0 • Public • Published

    stylelint-unused-classes

    Purpose

    Finds out possibly unused class selectors (.my-class) and id selectors (#my-element) by statically analyzing the source code that generates HTML.

    Currently Erb and Haml are supported.

    Getting started

    First, configure unused-classes.

    Then install stylelint and stylelint-unused-classes:

    npm install -D stylelint stylelint-unused-classes
    # OR
    yarn add -D stylelint stylelint-unused-classes
    

    Configure .stylelintrc.js:

    module.exports = {
      plugins: ["stylelint-unused-classes"],
      rules: {
        "unused-classes/unused-classes": [
          require.resolve("./classes.json"),
          {
            severity: "warning",
          },
        ],
      },
    };

    Options

    Primary option

    A string pointing to the file generated by unused-classes.

    Install

    npm i stylelint-unused-classes

    DownloadsWeekly Downloads

    233

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    5.96 kB

    Total Files

    4

    Last publish

    Collaborators

    • qnighy
    • izumin5210
    • wantedly_dev
    • kobayang