Code Monkey home page Code Monkey logo

stylelint-loader's Introduction

DEPRECATION NOTICE

This package is now deprecated. Do not use. Replace your packages with postcss-loader or [webpack-stylelint-loader] instead.

Recursively Linting with Stylelint

Stylelint does not do a good job of handling imported files, and stylelint-loader is a wrapper around stylelint, so it inherits all the bugs and issues of stylelint. You can use the stylelint-webpack-plugin to recursively lint all your stylesheets. See the stylelint-webpack-plugin for more details (and thanks to @vieron for providing the plugin).

I'm likely to be shutting down stylelint-loader in preference to the stylelint-webpack-plugin in the future.

Contributing

I am no longer accepting contributions as this package is deprecated.

stylelint-loader's People

Contributors

canvaspixels avatar thibthib 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

stylelint-loader's Issues

Error: You must use a valid syntax option, either: scss, less or sugarss

When I try to use stylelint-loader I get the following error on every css file:

Module build failed: Error: You must use a valid syntax option, either: scss, less or sugarss

Here's my webpack config:

module: {
  preloaders: [
    {
      test: /\.css$/,
      loader: 'stylelint',
      include: srcPath,
    },
  ],
  loaders: [
    {
      test: /\.css$/,
      include: srcPath,
      loader: 'style!css!postcss'
    },

    ...
  ],
},
stylelint: {
  configFile: path.join(__dirname, relativePath, '.stylelintrc'),
},

My .stylelintrc:

{
  "extends": "stylelint-config-standard"
}

Using the CLI everything works fine.

Here some information about the package versions I have:

node: 6.3.1
stylelint: 7.1.0,
stylelint-loader: 6.1.0,
webpack: 1.13.1

Please let me know if you need any additional information.

ERROR in Cannot find module 'chalk'

Hi,
Tell me please why I get error when I run webpack with style-loader?:
ERROR in Cannot find module 'chalk'

Node: v4.4.2
NPM: 2.15.3
OS: Windows 10

Change stylelint-loader default config file to .stylelintrc

Currently the loader will emit warnings about the configFile missing even if it hasn't been specified. As styleloader will happily figure out the correct configFile by itself (or fall back to the package.json config) this seems redundant.

A workaround is explicitly adding stylelint: {configFile: false} to the webpack config to avoid the loader's warnings.

Add tests for imported files with errors

There is an issue where errors reported by files imported by other sass files are not bubbled up correctly. Need to see what is going on, design a unit test and then fix the test.

Chalk is not defined in package.json

I'm seeing the ERROR in Cannot find module 'chalk' when using this loader.

I believe that the issue is that chalk is not defined as a dependency of this module. This wasn't an issue for me running under npm v3 as it has has flat module dependencies and chalk is a dependency of stylelint. I picked up the issue when running webpack using npm v2. Chalk is not available to stylelint-loader when using npm v2 and this causes the above error

Why stylelint loader caches files?

Hi,
Could you please explain what is the point to cache files in stylelint loader?
In the current implementations linter checks each file only once.

Let's take an example. One of project style files has lint error:

  1. User runs webpack dev server.
  2. User sees stylelint error.
  3. User does some changes on the same file, but doesn't fix the problem.
  4. Webpack re-rebundles files.
  5. User doesn't see the error anymore.
  6. However the lint error still exist.

Looks like a bug for me.

P. S. Temporary workaround to add ignoreCache: true to webpack config file.

SCSS errors not showing in console

This could be something I've done wrong.

I was following this tutorial (https://shellmonger.com/2016/01/29/integrating-sass-lint-with-webpack/comment-page-1/) to figure out how to add stylelint to Webpack.

I’m running Eslint for my js which is working fine. But for some reason nothing happens with my scss no matter how badly I break the rules I set.

I’m using the following in my webpack config (Full config file here: http://codepen.io/davislurve/pen/gPdxzB):

stylelint: {
    configFile: path.join(__dirname, ‘./.stylelint.config.js’),
    rules: {
        ‘function-url-quotes’: ‘single’,
        ‘indentation’: [ 4, { warn: true } ],
        ‘string-quotes’: ‘single’
    }
}

but when I use double quotes or 2 space indentation in my SCSS code nothing appears in the console.

It also doesn’t throw an error if I change the config file name e.g:

configFile: path.join(__dirname, ‘./SOME_RANDOM_FILE.config.js’),

I was expecting an error saying the file can’t be found or something. So I’m wondering if it’s even being initiated properly.

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.