Open jonashartwig opened 8 years ago
+1
@jonashartwig making sure I understand, you are not seeing any output from the plugin?
Yes, I don not see any warnings, errors. No information in general about anything regarding the plugin.
@jonashartwig Oh, okay so I think I know what is going wrong. You don't have a context set with webpack OR with the sasslint plugin, if you set the context (see readme) it should work.
Hi, thank you for the reply. I am not quite understanding what this context is supposed to be. I assume it is the folder where all my scss files are?
If so thing is they are spread across lots of folders.
EDIT: After reading lots of other posts i conclude it should be like this: context: require.context("/", false, "*/.scss") However i get this error: TypeError: require.context is not a function
Regards
Well we already have a glob setup for **/*.s[a|c]ss
so the end of that isn't needed.
If your webpack config is at the root of your repo, try setting the context option to ./
, if it's not at the root, do a path so it goes to the root: ./../../
or something.
So we're still struggling with this. Tried to make it as basic as possible in my webpack.conf. Want it to break on both errors and warnings though to clearly see when/if it works.
var sassLintPlugin = require('sasslint-webpack-plugin');
module.exports = {
loaders: [
{
test: /\.scss$/,
exclude: /node_modules/,
loader: ExtractTextPlugin.extract('style', 'css?sourceMap&-minimize!postcss!sass?sourceMap')
}
]
plugins: [
new sassLintPlugin({
failOnWarning: false,
failOnError: false
})
],
}
Moved my .sass-lint-yml to the same folder as my webpack.config (takes that file as default if no conf-file is specified in the plugin according to docs).
/build
- webpack.dev.config.js
- .sass-lint.yml
/src/styles
- main.scss
Cleaned my .sass-lint-yml to only contain some basic rules + a scope of which files to use (only scss). Throw error when using id + trailing semicolons.
files:
include: '**/*.scss'
rules:
no-ids: 2
trailing-semicolon: 2
When I edit my main.scss file, adding an id-selector and not using semicolons it triggers a re-compile but no errors are thrown.
I've tried setting a context as u mentioned above, but no cigarr.
@ssolders I apologize, I'm not quite sure what is going wrong. I had a few bug fixes (but they should be unrelated) currently in this PR: https://github.com/alleyinteractive/sasslint-webpack-plugin/pull/6 which if you pull in that commit after uninstalling the current version, I'd be curious if that might fix it.
I also don't use the files:
config in my .sass-lint.yml as the plugin handles all of that via the glob.
I'll try and replicate your issue this week and see if I can't get it to occur (and then fix it).
Hi,
I am not quite sure on how to explain this issue. I put up some rules:
and i plugged that stuff into my webpack config:
and i have some css which is incorrect according to the rules:
which is imported in one of my React components:
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