GithubHelp home page GithubHelp logo

sasslint-webpack-plugin's Introduction

##Notice: We are no longer actively developing (or updating) this plugin, we have switch to using Stylelint via the Webpack Plugin here.

NOTE Due to how non-js files are handled via webpack, this has been forked from sasslint-loader and rewritten as plugin instead of a loader.

Sasslint Plugin

Sasslint plugin for Webpack

Install

$ npm install sasslint-webpack-plugin

Usage

In your webpack configuration

var sassLintPlugin = require('sasslint-webpack-plugin');


module.exports = {
  // ...
  plugins: [
    new sassLintPlugin(),
  ],
  // ...
}

Options

You can customize the lint settings via a .sass-lint.yml file. See sasslint options, for complete options.

  • configFile: You can change the config file location. Default: (.sass-lint.yml)
  • context: Array of strings or String, Change the root of your SCSS files. Default inherits from webpack config.
  • ignoreFiles: Array of files to ignore, must be full path, Default: none
  • ignorePlugins: Array of plugins to ignore, Default: none (example: extract-text-webpack-plugin)
  • glob: Change the glob pattern for finding files. Default: (**/*.s?(a|c)ss)
  • quiet: Suppress warnings, errors will still show. Default: false
  • failOnWarning: Have Webpack's build process die on warning. Default: false
  • failOnError: Have Webpack's build process die on error. Default: false
  • testing: Quites output normally for testing purposes, Default: 'false' Caution do not use this unless you are catching errors via Webpack CLI!
// Default settings
module.exports = {
  plugins: [
    new sassLintPlugin({
      configFile: '.sass-lint.yml',
      context: ['inherits from webpack'],
      ignoreFiles: [],
      ignorePlugins: [],
      glob: '**/*.s?(a|c)ss',
      quiet: false,
      failOnWarning: false,
      failOnError: false,
      testing: false
    }),
  ]
}

Errors and Warnings

The plugin will dump full reporting of errors and warnings. You can use the quiet option to hide files which only have warnings. quiet will not hide errors, nor will it hide warnings on files with errors.

Extract Text Plugin

You will can duplicate output of errors and warnings if you use the extract-text-webpack-plugin, add it to the ignorePlugins config option to prevent that.

NoErrorsPlugin

NoErrorsPlugin prevents Webpack from outputting anything into a bundle. So even sass-lint warnings will fail the build. No matter what error settings are used for sasslint-webpack-plugin.

So if you want to see sass-lint warnings in console during development using WebpackDevServer remove NoErrorsPlugin from webpack config.

License

sasslint-webpack-plugin's People

Contributors

dmachat avatar jackmarketon avatar karlhorky avatar randycoulman avatar sompylasar avatar yangshun 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

Watchers

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

sasslint-webpack-plugin's Issues

Unable to make "file" configuration work

I use sasslint-webpack plugin to process '.scss' files in a specific directory, targeted by glob and reading rules from .sass-lint.yml. Works amazingly well - thank you!
I need to be able to exclude specific files. It appears that, no matter what I write in my .sass-lint.yml for file configuration, for either ignore or include (specific file path, regex, directory), it doesn't have any effect. The issue is very high priority for us because we are planning to include sasslint-webpack-plugin in our automated build. Please help!

Duplicative Lint

When I use this with extract-text-webpack-plugin, it seems to work twice unnecessarily. I guess some conflict was caused with the plugin.
If I remove extract-text-webpack-plugin, it works fine.

Here is output.

./src/css/components/list.scss
  11:7  warning  Nesting depth 3 greater than max of 2  nesting-depth
  15:9  warning  Nesting depth 4 greater than max of 2  nesting-depth

✖ 2 problems (0 errors, 2 warnings)


./src/css/components/list.scss
  11:7  warning  Nesting depth 3 greater than max of 2  nesting-depth
  15:9  warning  Nesting depth 4 greater than max of 2  nesting-depth

✖ 2 problems (0 errors, 2 warnings)

Any ideas?
My code is here.

Warnings displayed twice

Hello,

Thanks for this helpful plugin, I have an issue which is annoying but not severe at all.

When I build my project with webpack, I have every warnings displayed twice:

WARNING in src/components/aw-components/aw-accordion/aw-accordion.scss

WARNING in src/components/aw-components/aw-input-slider/aw-input-slider.scss

WARNING in src/components/aw-components/aw-menu/sidebar/aw-navigator-sidebar-menu.scss

WARNING in src/components/aw-tour-guide/aw-tour-guide.scss

WARNING in src/containers/app-content/app-content.scss

WARNING in src/styles/_components/_viewport.scss

WARNING in src/views/edit/edit-view.scss

WARNING in src/views/live/live-view.scss

WARNING in src/views/live/sources/inputs/input/input-list-view-renderer-medium.scss

WARNING in src/views/live/sources/logos/logos-list-view-item-renderer-medium.scss
Child html-webpack-plugin for "index.html":
         Asset    Size  Chunks       Chunk Names
    index.html  552 kB       0

    WARNING in src/components/aw-components/aw-accordion/aw-accordion.scss

    WARNING in src/components/aw-components/aw-input-slider/aw-input-slider.scss

    WARNING in src/components/aw-components/aw-menu/sidebar/aw-navigator-sidebar-menu.scss

    WARNING in src/components/aw-tour-guide/aw-tour-guide.scss

    WARNING in src/containers/app-content/app-content.scss

    WARNING in src/styles/_components/_viewport.scss

    WARNING in src/views/edit/edit-view.scss

    WARNING in src/views/live/live-view.scss

    WARNING in src/views/live/sources/inputs/input/input-list-view-renderer-medium.scss

    WARNING in src/views/live/sources/logos/logos-list-view-item-renderer-medium.scss
webpack: bundle is now VALID.

Does it have any link with this issue?

Here is my config:

 Linter Options
options:
  # Cache config
  cache-config: true
  # Set the formatter to 'html'
  formatter: html
# Rule Configuration
rules:
  # Extends
  placeholder-in-extend: 0

  # Line spacing
  empty-line-between-blocks:
    - 1
    -
      allow-single-line-rulesets: false

  # Disallows
  no-combinators: 1
  no-duplicate-properties:
    - 1
    -
      exclude:
        - src
  no-ids: 0
  no-important: 0
  no-qualifying-elements:
    - 1
    -
      allow-element-with-attribute: true
  property-units:
    - 1
    -
      global: ['em', 'rem', '%', 'px', 's', 'ms']

  # Nesting
  force-attribute-nesting: 0
  force-pseudo-nesting: 0

  # Name Formats
  class-name-format:
    - 1
    -
      allow-leading-underscore: false
      convention: hyphenatedbem
      convention-explanation: 'Class must contain only lowercase letters, underscores and hyphens'
  function-name-format:
    - 1
    -
      allow-leading-underscore: false
  id-name-format:
    - 1
    -
      allow-leading-underscore: false
      convention: camelcase
      convention-explanation: 'IDs must be in camelCase'
  mixin-name-format:
    - 1
    -
      allow-leading-underscore: false
  placeholder-name-format:
    - 1
    -
      allow-leading-underscore: false
  variable-name-format:
    - 1
    -
      allow-leading-underscore: false

  # Style Guide
  brace-style:
    - 1
    -
      allow-single-line: false
  leading-zero:
    - 1
    -
      include: true
  property-sort-order: 0
  variable-for-property:
    - 1
    -
      properties:
        - 'margin'
        - 'padding'

And the sasslint-webpack-plugin configuration:

if (__DEV__) {
  webpackConfig.plugins.push(
    new SassLintPlugin({
      context: 'src',
      ignorePlugins: ['extract-text-webpack-plugin'],
      glob: '**/*.scss'
    })
  )
}

Note: We started the project from React-Redux Starter Kit by davezuko.

Any idea? Maybe I did something wrong… I can't find where I screwed up :/

Thanks!

Allow multiple entry points

Occasionally some projects require multiple entry points for scss files. This plugin should support that.

Allow use of include/ignore from sass-lint config file

Thanks for this plugin! It works great for me, and gets around an issue I was having with the older sasslint-loader project.

I want to be able to run sasslint via this plugin, and also using its own cli (via a npm run lint script). In order to do that, I have to duplicate the files section of my .sass-lint.yml file when I configure this plugin. It would be nice if the plugin could just use the settings from my sass-lint config file instead of requiring duplicate configuration.

I did some experimentation with this idea and found that I could just pass null into sasslint.lintFiles, and it would use its own configuration values. That worked fine in my project.

That would obviously not be backwards-compatible here, so I started working on a PR with a better solution and ran into trouble. The main issue is that the webpack context and the working directory when running the npm script might be different, so the file/include setting in the sass-lint config file might not work in both situations.

I discovered this issue when I tried to get my changes working with the existing test suite. Those tests rely on setting the webpack context to the correct test directory when running.

Do you have any suggestions on how to approach this task? I'm happy to keep working on my PR, but I'm kind of stuck on how to make the context and sasslint config play nicely together.

Thanks!

Numerous linting errors

I forked the project and immediately tried to do npm run lint and was greeted with 207 lint errors.

I'm about to start working on a PR and want to be sure that my code follows the desired style for this project, but it looks like I can't use lint for that purpose.

Move print of warnings to the end

Hello, i started to use this plugin, but when any warning/error is printed to the console it is printed to the end of webpack stack like this, and i have to scroll 400 lines to the up to see real warnings

screenshot 2016-05-22 01 07 08

I was experimenting with this source

// Hook into the compilation as early as possible, at the seal step
    compilation.plugin('seal', function() {
      // We need to keep the reference to the compilation's scope
      var _this = this;

      // Errors/Warnings are pushed to the compilation's error handling
      // so we can drop out of the processing tree on warn/error
      report.forEach(function(x) {
        if(x.error) {
          _this.errors.unshift(x.file);
        } else {
          _this.warnings.unshift(x.file);
        }
      });

and changed seal to the done now i get expected result in console
screenshot 2016-05-22 01 09 21

Is there any particular reason to hook into seal step? If not it is possible to change this or open PR with this? Thanks

Add ability to eliminate a lint rule per line or file

See [http://stackoverflow.com/questions/35136098/have-sass-lint-ignore-a-certain-line] for a thread on this. It seems that scss lint might support this in a similar way to eslint for JS files

There are often a few cases in any code base where you need to disable a lint rule for some particular reason. In my case, I need to import Google Material Design icons, but the documented css logic causes no-duplicate-properties and no-vendor-prefixes to fire. I therefore want to keep those rules for every other file in my tree except my font.scss file

// http://google.github.io/material-design-icons/
@font-face {
  font-family: 'Material Icons';
  font-style: normal;
  font-weight: 400;
  src: url('~material-design-icons/iconfont/MaterialIcons-Regular.eot'); // IE
  src: local('Material Icons'),
  local('MaterialIcons-Regular'),
  url('~material-design-icons/iconfont/MaterialIcons-Regular.woff2') format('woff2'),
  url('~material-design-icons/iconfont/MaterialIcons-Regular.woff') format('woff'),
  url('~material-design-icons/iconfont/MaterialIcons-Regular.ttf') format('truetype');
}

.material-icons {
  // Firefox
  -moz-osx-font-smoothing: grayscale;
  // WebKit
  -webkit-font-smoothing: antialiased;
  direction: ltr;
  display: inline-block;
  font-family: 'Material Icons';
  // IE
  font-feature-settings: 'liga';
  // preferred icon size
  font-size: 24px;
  font-style: normal;
  font-weight: normal;
  letter-spacing: normal;
  line-height: 1;
  // Safari, Chrome
  text-rendering: optimizeLegibility;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
}

Error: EISDIR: illegal operation on a directory, read

When I try to use the plugin I get the following error:

fs.js:603
  var r = binding.read(fd, buffer, offset, length, position);
                  ^

Error: EISDIR: illegal operation on a directory, read
    at Error (native)
    at Object.fs.readSync (fs.js:603:19)
    at Object.fs.readFileSync (fs.js:438:24)
    at /Users/ngerritsen/Projects/php-coolblue-edith/node_modules/sass-lint/index.js:180:18
    at Array.forEach (native)
    at Function.sassLint.lintFiles (/Users/ngerritsen/Projects/php-coolblue-edith/node_modules/sass-lint/index.js:178:9)
    at lint (/Users/ngerritsen/Projects/php-coolblue-edith/node_modules/sasslint-webpack-plugin/lib/linter.js:18:25)
    at /Users/ngerritsen/Projects/php-coolblue-edith/node_modules/sasslint-webpack-plugin/index.js:15:30
    at Array.forEach (native)
    at Compiler.<anonymous> (/Users/ngerritsen/Projects/php-coolblue-edith/node_modules/sasslint-webpack-plugin/index.js:14:14)
    at Compiler.applyPlugins (/Users/ngerritsen/Projects/php-coolblue-edith/node_modules/webpack/node_modules/tapable/lib/Tapable.js:26:37)
    at Compiler.newCompilation (/Users/ngerritsen/Projects/php-coolblue-edith/node_modules/webpack/lib/Compiler.js:364:7)
    at Compiler.compile (/Users/ngerritsen/Projects/php-coolblue-edith/node_modules/webpack/lib/Compiler.js:392:25)
    at Watching.<anonymous> (/Users/ngerritsen/Projects/php-coolblue-edith/node_modules/webpack/lib/Compiler.js:46:17)
    at Compiler.next (/Users/ngerritsen/Projects/php-coolblue-edith/node_modules/webpack/node_modules/tapable/lib/Tapable.js:67:11)
    at Compiler.invalidAsyncPlugin (/Users/ngerritsen/Projects/php-coolblue-edith/node_modules/webpack-dev-server/node_modules/webpack-dev-middleware/middleware.js:79:3)

I have no idea why, my webpack build works without this plugin. Config:

.sass-lint.yml

indentation:
  - 2
  -
    size: 2

webpack.config.js (partially)

plugins: [
    new HtmlWebpackPlugin({
      title: 'Coolblue Edith',
      filename: 'index.html',
      template: './client/index.html',
      inject: true,
      favicon: './client/images/favicon.ico',
      hash: true
    }),
    new ExtractTextPlugin('style.css'),
    new SassLintPlugin(),
    new webpack.optimize.CommonsChunkPlugin('vendor', 'vendor.js')
  ]

Any ideas?

Upgrade to node-sass 4.5.3 for NodeJS 8 compatibility

Can you please upgrade this project to 4.5.3? Due to the major version jump, using this webpack plugin causes the old 3.13 to be installed as a sub-dependency instead of using the 4.x version. This then fails on NodeJS 8 due to missing node-sass bindings. Node 7 works with either version of node-sass so bumping should be fine (barring compat issues in your code)

I couldn't find a way to force an upgrade in my own package definitions

Webpack 4 support

1.0.4

After update to Webpack 4 this plugin begins to crash with

C:\sources\crm-frontend\node_modules\sasslint-webpack-plugin\index.js:47
          _this.warnings.push(x.file);
                         ^

TypeError: Cannot read property 'push' of undefined
    at C:\sources\crm-frontend\node_modules\sasslint-webpack-plugin\index.js:47:26
    at Array.forEach (<anonymous>)
    at C:\sources\crm-frontend\node_modules\sasslint-webpack-plugin\index.js:43:14
    at SyncHook.eval [as call] (eval at create (C:\sources\crm-frontend\node_modules\tapable\lib\HookCodeFactory.js:17:12), <anonymous>:7:1)
    at SyncHook.lazyCompileHook [as _call] (C:\sources\crm-frontend\node_modules\tapable\lib\Hook.js:35:21)
    at Compilation.seal (C:\sources\crm-frontend\node_modules\webpack\lib\Compilation.js:826:19)
    at hooks.make.callAsync.err (C:\sources\crm-frontend\node_modules\webpack\lib\Compiler.js:464:17)
    at _err0 (eval at create (C:\sources\crm-frontend\node_modules\tapable\lib\HookCodeFactory.js:24:12), <anonymous>:11:1)
    at _addModuleChain (C:\sources\crm-frontend\node_modules\webpack\lib\Compilation.js:749:12)
    at processModuleDependencies.err (C:\sources\crm-frontend\node_modules\webpack\lib\Compilation.js:688:9)
    at process._tickCallback (internal/process/next_tick.js:150:11)

How to ignore files from 'node_modules'.

Could someone suggest how to configure sassLintPlugin to ignore files from node_modules folder (or any other)?

The ignoreFiles option only works for me if I add the path to every file.

Here is my config:

module.exports = {
    ...
    plugins: [
        new HtmlWebpackPlugin({
            inject: true,
            template: path.resolve('index.html'),
            favicon: path.resolve('favicon.ico')
        }),
        new ExtractTextPlugin('build/styles.css'),
        new sassLintPlugin({
            ignoreFiles: [
                path.resolve('node_modules/sasslint-webpack-plugin/test/testfiles/test7/_second.scss'),
                path.resolve('node_modules/sasslint-webpack-plugin/test/testfiles/test6/test.scss'),
                path.resolve('node_modules/sasslint-webpack-plugin/test/testfiles/test3/test.scss')            ],
            ignorePlugins: ['extract-text-webpack-plugin']
        })
    ]
};

With this setup, only those three files are ignored but there are plenty of files from node_modules which produce a lot of warnings.

Thanks.

Cannot find module 'text-table'

Hi!

On a fresh install of this package, I get an error when I try to start my webpack dev server.

module.js:339
    throw err;
    ^

Error: Cannot find module 'text-table'

I think it is because of this require: https://github.com/alleyinteractive/sasslint-webpack-plugin/blob/master/lib/formatter.js#L8

I fixed this problem by adding text-table as a dev dependency to my package.json manually, but I think you need to add it as a dependency or peer dependency rather than a dev dependency in this repo.

Returns nothing...

Whenever I run my webpack operation, no sass-lint operations return errors (or warnings).
Here is my portion of webpack.config

   new sassLintPlugin({
      configFile: '.sass-lint.yml',
      context: ['inherits from webpack'],
      ignoreFiles: ['./sass/disabled/**/*.s+(a|c)ss','./sass/modules/**.s+(a|c)ss', './node_modules/**/*.s+(a|c)ss'],
      ignorePlugins: [],
      glob: './sass/**/*.s?(a|c)ss',
      quiet: false,
      failOnWarning: false,
      failOnError: false,
      testing: false
    }),

And here is a tree which contains the sass files

.
├── app.sass
├── bootstrap.sass
├── disabled
│   └── test.sass
├── mixins
│   ├── bem.sass
│   └── text.sass
├── modules
│   └── reset.scss
├── sample.sass
└── sass.html

3 directories, 8 files

And finally, the output from Webpack

Build completed in 0.567s

Hash: a0e651e52020c2707dcb
Version: webpack 1.13.1
Time: 573ms
    Asset     Size  Chunks             Chunk Names
bundle.js  12.9 kB       0  [emitted]  main
    + 10 hidden modules

WARNING in ./index.js

/Users/mikeerickson/Documents/Projects/sandbox/src/index.js
  2:1  warning  Unexpected 'debugger' statement  no-debugger

✖ 1 problem (0 errors, 1 warning)

Cleanup

There is still a single test that is failing, and the repo needs cleanup to meet with our ESLint standards.

More descriptive errors

With eslint-loader I get fairly descriptive errors in my UI, but the errors from this plugin aren't entirely helpful:

screen shot 2016-09-02 at 2 33 59 pm

Is there something I can do to configure this behavior, or is this just missing that functionality.

Configuration problem

Hi,

I am not quite sure on how to explain this issue. I put up some rules:

files:
  include: '**/*.s+(a|c)ss'
# Rule Configuration
rules:
  brace-style:
    - 1
    -
      style: "1tbs"
      allow-single-line: false
  class-name-format:
    - 2
    - allow-leading-underscore: false
  empty-line-between-blocks:
    - 2
    - include: true
    - allow-single-line-rulesets: false
  extends-before-mixins: 2
  extends-before-declarations: 2
  force-attribute-nesting: 2
  force-element-nesting: 2
  force-pseudo-nesting: 2
  placeholder-in-extend: 2
  mixins-before-declarations:
    - 2
    -
      exclude:
        - breakpoint
        - mq
  no-duplicate-properties: 2
  one-declaration-per-line: 2
  space-before-bang: 1
  space-after-bang:
    - 1
    -
      include: false
  space-after-colon: 1
  no-warn: 1
  no-debug: 1
  no-ids: 2
  no-important: 1
  space-after-comma: 1
  space-around-operator: 1
  space-before-colon: 1
  space-between-parens: 1
  trailing-semicolon: 2
  hex-notation:
    - 2
    -
      style: uppercase
  indentation:
    - 1
    -
      size: 4
  property-sort-order:
    - 1
    -
      order:
        - display
        - margin
      ignore-custom-properties: true
  variable-for-property:
    - 2
    -
      properties:
        - margin
        - content

and i plugged that stuff into my webpack config:

module.exports = {
    name: 'client',
    target: 'web',
    devtool: 'inline-source-map',
    resolve: {
        root: utils_paths.source(),
        extensions: ['', '.js', '.jsx', '.json']
    },
    entry: {
        app: ['main.js', 'webpack-hot-middleware/client'],
        vendor: [
            'history',
            'react',
            'react-redux',
            'react-router',
            'react-router-redux',
            'redux'
        ]
    },
    output: {
        filename: '[name].[hash].js',
        path: 'dist'
    },

    module: {
        preLoaders: [{
            test: /\.jsx?$/,
            loader: 'eslint',
            exclude: /node_modules/
        }],
        loaders: [
            {
                test: /\.jsx?$/,
                exclude: /node_modules/,
                loader: 'babel',
                query: {
                    cacheDirectory: true,
                    plugins: ['transform-runtime'],
                    presets: ['es2015', 'react', 'stage-0'],
                    env: {
                        development: {
                            plugins: [
                                ['react-transform', {
                                    transforms: [{
                                        transform: 'react-transform-hmr',
                                        imports: ['react'],
                                        locals: ['module']
                                    }, {
                                        transform: 'react-transform-catch-errors',
                                        imports: ['react', 'redbox-react']
                                    }]
                                }]
                            ]
                        },
                        production: {
                            plugins: [
                                'transform-react-remove-prop-types',
                                'transform-react-constant-elements'
                            ]
                        }
                    }
                }
            },
            {
                test: /\.json$/,
                loader: 'json'
            },
            {
                test: /\.scss$/,
                exclude: /node_modules/,
                loader: ExtractTextPlugin.extract('style', 'css?sourceMap&-minimize!postcss!sass?sourceMap')
            },
            {
                test: /\.css$/,
                exclude: /node_modules/,
                loaders: ExtractTextPlugin.extract('style', 'css?sourceMap&-minimize!postcss')
            },
        ]
    },
    plugins: [
        new NpmInstallPlugin({
            saveDev: true
        }),
        new webpack.DefinePlugin({
            'process.env': {
                NODE_ENV: JSON.stringify('development')
            },
            '__BASENAME__': JSON.stringify('')
        }),
        new HtmlWebpackPlugin({
            template: 'index.html',
            hash: false,
            filename: 'index.html',
            inject: 'body',
            minify: {
                collapseWhitespace: true
            }
        }),
        new sassLintPlugin({
            configFile: '.sass-lint.yml',
            failOnError: true
        }),
        new ExtractTextPlugin('[name].[contenthash].css', {
            allChunks: true
        }),
        new webpack.HotModuleReplacementPlugin(),
        new webpack.optimize.CommonsChunkPlugin({
            names: ['vendor']
        })
    ],
    eslint: {
        configFile: '.eslintrc'
    },
    sassLoader: {
        includePaths: [utils_paths.source()]
    },
    postcss: [
        cssnano({
            autoprefixer: {
                add: true,
                remove: true,
                browsers: ['last 2 versions']
            },
            discardComments: {
                removeAll: true
            },
            safe: true,
            sourcemap: true
        })
    ],
    stats: {
        children: false
    }
};

and i have some css which is incorrect according to the rules:

.container{margin: 0}

which is imported in one of my React components:

import '../styles/main.scss';

Unfortunately, no matter what i do and try, I see any kind of output of the scss linter.
I can force errors during loading if i mess up the config file. So that one is loaded.

Any ideas?

Jonas

Not using configFile and requires full path to ignored files

I have the following (configuration)

  • It is NOT using the include/ignore files form .sass-lint.yml file
  • In order to properly ignore files, I must use the full path (see first entry) where as the format for second entry (yes they are different files, just testing various options).
  • The first entry is ignored correctly (notice full path)
  • The second entry is NOT ignored
    new SassLintPlugin({
      configFile: '.sass-lint.yml',
      ignoreFiles: [
        '/Users/mikeerickson/Documents/Projects/angular-sandbox/src/sass/mixins/text.sass',
        './src/sass/modules/_reset.scss'
      ]
    }),

Here is my result when running webpack

...
/Users/mikeerickson/Documents/Projects/angular-sandbox/src/sass/modules/_reset.scss
   1:6   warning  Selectors must be placed on new lines                           single-line-per-selector
   1:12  warning  Selectors must be placed on new lines                           single-line-per-selector
...

As you can see, the _reset.scss file is still being checked, despite its defined ignore item

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.