How can I prevent ESLint from failing the build but preserve the rule severity.
I have a jenkins job, that should succeed also if there are listing issues. This was possible with gulp but i don't know how to do it with grunt.
Related
Calling grunt-eslint causes a Cannot find module 'eslint-plugin-react' error that doesn't happen when calling eslint directly from the command line.
I have eslint-plugin-react installed globally.
Is there an easy way to make grunt eslint behave the same way as eslint?
Assuming you don't want to install the node module locally for some reason, I can think of two options. 1. Use grunt-exec within your grunt file to run eslint, or 2. As per the answer in the link below setup a symbolic link to your global node modules folder:
How to use grunt-html installed globally?
I've installed both the grunt-cli and grunt globally using the -g option.
However when I try and run grunt I get this error:
grunt --gruntfile /Users/a/root/config/Gruntfile.js
grunt-cli: The grunt command line interface. (v0.1.13)
Fatal error: Unable to find local grunt.
If you're seeing this message, either a Gruntfile wasn't found or grunt
hasn't been installed locally to your project. For more information about
installing and configuring grunt, please see the Getting Started guide:
http://gruntjs.com/getting-started
This is confusing as it seems to say that you are suppose to do a local install.
It seems contradictory actually. I clearly have a grunt file in place.
Grunt-cli is installed globally so that the grunt command is available to be run from any location on your system. Without the global installation, you would need to rely on somewhat abstract methods of running local grunt installs (npm run-script and friends), which are clunky for this use.
The entire point of the global install is only to load and run a local Gruntfile.js using the locally installed version of Grunt. The error message indicates this:
either a Gruntfile wasn't found or grunt hasn't been installed locally to your project.
In other words, to run Grunt, you need to create a Gruntfile.js and you must have a local copy of Grunt installed to your project alongside the file. The CLI is just there to kick off the process without troublesome fiddling.
I've used grunt with grunt watcher: siteaccess some time. To compile my less into css.
I use phpstorm.
But somehow it won't work anymore! I don't know why but it won't really install grunt. it works when i use grunt cache but not grunt watche.
Anyone has any idea?
I am trying to build a yeoman generator and using the tutorial as a guide
http://yeoman.io/generators.html#writing-your-first-generator
I copied the Gruntfile.js from the gist referenced and put it in my generator's template directory. When I generate the project, I run
npm install && bower install
then
grunt test
Local Npm module "grunt-template-jasmine-requirejs" not found. Is it installed?
Warning: Task "concurrent:test" not found. Use --force to continue.
Aborted due to warnings.
Execution Time (2014-01-10 16:19:20 UTC)
loading tasks 3ms
▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 50%
test 2ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 33%
Total 6ms
It is not clear to me why Grunt concurrent:test is not found. Grunt finds the clean:test task. I tried commenting the concurrent task and none of the other tasks were found for "test" except "clean". Here is the task list
grunt.registerTask('test', [
'clean:server',
'concurrent:test',
'autoprefixer',
'connect:test',
'karma'
]);
Good point jakerella I see now I was using different grunt file in my yeoman generator then I intended. When I replace Gruntfile.js with the one from the gist referenced in the yeoman tutorial, I get the same issue with a different task. Its says "watch" is not found.
$ ls node_modules/
bower grunt-contrib-compass grunt-contrib-jshint grunt-template-jasmine-requirejs
connect-livereload grunt-contrib-concat grunt-contrib-jst grunt-usemin
grunt grunt-contrib-connect grunt-contrib-livereload load-grunt-tasks
grunt-bower-requirejs grunt-contrib-copy grunt-contrib-requirejs matchdep
grunt-connect-proxy grunt-contrib-cssmin grunt-contrib-uglify moment
grunt-contrib-clean grunt-contrib-htmlmin grunt-open time-grunt
grunt-contrib-coffee grunt-contrib-imagemin grunt-regarde
$ grunt server
>> Local Npm module "grunt-template-jasmine-requirejs" not found. Is it installed?
Warning: Task "watch" not found. Use --force to continue.
Aborted due to warnings.
$
I had the same problem. I solved it by running:
npm install grunt-x --save-dev replacing x with the name of the missing task repeatedly until done.
Incidentally I has first tried npm install -g grunt-x and that didn't work.
After some work at identifying dependencies, I was able to get this to work once I copied the entire foundation app directory and then used the foundation5 generator's index.js list of files to copy from the template directory as a guide to additional resources that were required by my generator. I think this may be a helpful way for anyone trying to repurpose existing generators and help identify Grunt dependencies.
Trying to set up Grunt with Roots Bootstrap Starter Template - Installation of grunt seemed to go perfectly fine - but when I run 'grunt watch' and go to change my .less files nothing happens in the terminal and grunt doesn't compile my changes. Here is my terminal output after installing > running grunt > and then running 'grunt watch'.
Jeffs-MacBook-Air:roots-master jeffsee55$ grunt
Running "clean:dist" (clean) task
Cleaning assets/css/main.min.css...OK
Cleaning assets/js/scripts.min.js...OK
Running "less:dist" (less) task
File assets/css/main.min.css created.
Running "uglify:dist" (uglify) task
File "assets/js/scripts.min.js" created.
Running "version" task
Versioning assets/css/main.min.css...OK
Versioning assets/js/scripts.min.js...OK
"lib/scripts.php" updated with new CSS/JS versions.
Done, without errors.
Jeffs-MacBook-Air:roots-master jeffsee55$ grunt watch
Running "watch" task
Waiting...
As I said, I then go to make changes to anything in ANY of my .less files which are located in assets/less. Any tips on troubleshooting? Perhaps reinstalling EVERYTHING including node.js?