alleyinteractive / sasslint-webpack-plugin

A webpack plugin to lint your SCSS/SASS code
MIT License
33 stars 12 forks source link

Error: EISDIR: illegal operation on a directory, read #9

Open ngerritsen opened 8 years ago

ngerritsen commented 8 years ago

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?

roelvanhintum commented 8 years ago

I'm having the same problem. Setting the context option solved it for me.

new SassLintPlugin({
  context: './src/sass/',
}),
jackmarketon commented 8 years ago

Marking this as closed as @roelvanhintum's solution solved it with a config option.

omasback commented 8 years ago

Kinda feel like this should remain open since the plugin completely breaks without setting this option which is, supposedly, optional.

DanPurdy commented 8 years ago

You'll want to check this again when sass-lint 1.8 arrives as there's a PR in at the moment to prevent directories being read for that version.

https://github.com/sasstools/sass-lint/pull/719

jackmarketon commented 8 years ago

@DanPurdy thanks!

xvvvyz commented 8 years ago

@DanPurdy @jackmarketon can confirm—sass-lint v1.8 fixes this issue.