I am using JsHint in a Makefile for a project I am working on and the errors that are reported are not being noticed by Make. Is there a way to capture the error and not hard exit the execution of Make? Below is a sample Makefile:
all: css js
css:
compass compile
hint:
jshint js/*.js
js: hint
uglify js/*.js
So, for example, the hint target is showing errors but is doing a hard exit and not informing Make that it exited.
I might not be using the correct terms for things and I apologize.
Use a hyphen before the recipe…
hint:
-jshint js/*.js
Related
I've tried to write SCSS in my Maven project with React in IDEA. I have sass and sass-loader in npm packages. But I always get a weird error:
Syntax error: missing semicolon
This is a very simple scss example for test. I can't use other tag selectors as well. I've added scss variable on the top to see if it causes an error but it doesn't and all the errors stop at tags. I think that means that scss file is readable after all. And everything is ok when using just css. What's going on?
I solved the problem. Maybe someday it would be useful for somebody.
The point is I missed restarting webpack when changing it. I found configs for sass-loader on its npm page and added it to my webpack.config.js and then run webpack --watch --progress. Everything finally worked
Can anyone please help explain this? I am new at using Sass. But I cant understand why people use compiler for sass files when they can be run through terminal.
I actually had the same question some time ago when I was learning SASS.
I kept wondering why most tutorials involved using GRUNT / GULP or some kind of task runner when there where sass proprietary commands even for live-watching your files with a command such as:
sass --watch app/sass:public/stylesheets
I will quote myself here in the question (that no one answered) just to share my experience with SASS compiling:
Grunt: using grunt-contrib-sass - Everything has worked smoothly; I chose this one over grunt-sass for no particular reason, but I've read that the latter uses libsass(c++) which is faster than the traditional ruby Sass.
Gulp: using gulp:sass - I often encounter an error when watching
files, it doesn´t find some partials, but if you save again,
everything is fine (this is addressed in their common issues -this
solution hasn't worked for me though), also it doesn't generate sass
maps as a default you have to use gulp-sourcemaps on top.
Straight from Console: no task runners - Works fine so far, generates
sourcemaps, and lets you know where there's an error, just like with
Grunt and Gulp.
So after working on different projects using SASS I'd say the reasons are:
Tutorials popularized the use of task runners when using SASS in its early times
In a project, you rarely use SASS just by itself, you most likely want to run other tasks, so it makes sense to add your SASS task to the flow, which saves time and makes sense.
It's easier to run a simple command such as gulp sass or just gulp to run the default gulp task (that should include the sass task) than to remember a long command in which you have to put the paths over and over again.
After a while I realized that you can use NPM scripts in your package.json to run the SASS command line tools like so:
"scripts": {
"sass": "sass --watch app/sass:public/stylesheets --style compressed"
},
And then run it from the command line: npm run sass
the above requires no configuration and you don't have to remember the whole command by heart.
To conclude, there is nothing wrong in using the CMD SASS without other compilers/task runners, just use whatever you feel most comfortable with.
I recently moved to Sass in a side project with Gulp. I'm used to LESS development and I'm finding hard to find some tools:
I want to keep a minimum code quality watcher in my project since we are more than one developer writting Sass (not only a linter for syntax errors)
I used to do it with recess for LESS >
https://github.com/twitter/recess
Or in Grunt, a quality code linter for Sass (grunt-scss-lint) >
https://github.com/ahmednuaman/grunt-scss-lint
What I'm trying to do is to set some quality code options like: maximum nesting depth, noIds, using dashes for classes...etc.
Is there any tool in Gulp for code linting?
There was no resources for linting SCSS in gulp yet so, with the help of my colleague Juanfran, we can finally lint our sass code with this gulp-scss-linter
Gulp plugin to validate .scss files with scss-lint
You can use Gulp Sass Lint npm package.
You can also use Sass Lint Auto Fix npm package with the above package which will fixes lint errors.
I have a directory of .scss files. I am using sass --watch src:public command to watch and compile files, that is working perfectly.
Is there any way to catch whenever there is an error ? Basically instead of going to terminal i want to produce a 'growl notification' whenever there is an error in compiling sass files.
Otherwise a way to detect change in bash output and just create a growl notification of it. It would be really helpful for me.
Yes you can use sass linter like sass lint to catch MOST of them
on top of that you can use IDE plugin as well, for example atom plugin
atom lint error demo
I'm very new to Linux and I'm using UBUNTU to run a code! when I use 'make' command to compile my 'Makefile' I get this error:
make:*** [mod_param.o] Error 127
could anyone tell me what is this error and why this happen?
Thanks in advance!
Whenever reading the output of a build, you want to go up and find the FIRST error message. That's almost always the important one. Once something fails, the rest of the errors might be cascading problems from the first one. In this case, that message is just make telling you that it tried to compile mod_param.c and it didn't work. You'll have to look at the messages BEFORE this one to see why the compile failed.