Git Product home page Git Product logo

stylelint-loader's Introduction

stylelint-loader

Stylelint is a modern linter that helps you enforce consistent conventions and avoid errors in your stylesheets. Powered by PostCSS, stylelint can understand any syntax that PostCSS can parse, including SASS and SCSS.

Stylelint-loader is a Webpack wrapper for handling stylelint verification while using webpack.

This fork provides an additional option to lint by original file options in stylelint

example:

   stylelint: {
       configFile: './stylelint.config.js',
       ignoreCache: true,
       files: 'src/**/**/**.scss',
       webpackWarnings: false,
       webpackErrors: false
   },

Installation

npm install --save-dev stylelint-loader stylelint

Usage

In your webpack.config.js file:

module.exports = {
    // ...
    module: {
        preLoaders: [
            { test: /\.(sass|scss)$/, loader: 'stylelint' }
        ],
        loaders: [
            { test: /\.(sass|scss)$/, loader: 'style|css|sass' }
        ]
    },
    // ...
    stylelint: {
        configFile: path.join(__dirname, './.stylelint.config.js'),
        configOverrides: {
            rules: {
                // Your rule overrides here
            }
        }
    }
};

Options

Create your lint configuration in the same way as stylelint. Specify the configuration file, probably as a .stylelint.config.js file, in the stylelint section of the webpack.config.js.

You can specify the following options in the stylelint section of your webpack.config.js file:

  • config is a stylelint configuration object
  • configFile is the path to a JSON, YAML or JS file that contains your configuration
  • configBasedir is an absolute path to a directory for relative paths defining extends and plugins in your configuration
  • configOverrides is a partial stylelint configuration object

If you do not specify config or configFile, then stylelint-loader will look in the standard rc-file places for a .stylelint.config.js file.

For more information, please review the stylelint node API documentation.

More Information

Please check out all the options available via stylelint

stylelint-loader's People

Watchers

James Cloos 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.