-
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
force flag #55
force flag #55
Conversation
Why? And you have a merge conflict. |
To build the project, I use the Grunt and one of the stages of the build is run linters to test the code. If linters gave me a message, this is not a reason not to build the project. Messages of linters are recommendations. I Generate the report and see it, fix the error, if possible at the moment. But I should be able to build the project, even with the presence of poor but working code. |
You can already do that with the |
I don't want to use --force flag for the whole grunt build task but eslint task itself. So the switch would be useful anyway as grunt doesn't support forcing particular tasks from gruntfile, does it? |
It doesn't. But where do you think this belongs, manually implemented in every grunt task or in grunt itself? ;) |
I totally agree mate, this should be definitely implemented in the Grunt itself. The trouble is that the issue has been opened almost two years ago and hasn't been resolved since then: gruntjs/grunt#810 |
I agree with @sindresorhus in principle but the option to don't break on error is something that is really helpful. 👍 if it matters |
@sindresorhus will you reconsider adding this option? If there is any issue with previous PR, I'd be happy to try to make a PR that satisfies your requirements. That option is a big deal and while grunt doesn't provide a way to force task, this will help a lot of people. It'll be really sad having to switch to a different grunt task only for that. Thanks |
I you don't want grunt-eslint to fail your whole build, just set your ESLint rules to warning instead of error. That's exactly what they're there for. |
Thanks @sindresorhus for your reply. However, I believe this doesn't solve my use case. I want my ESLint rules to throw errors, so in dev environment, developer get errors when they don't follow the rules. However, I want to be able to use ESLint before deploying, with the same config and see if the code that's going to be deployed follows all the rules as well. However, if for some strange reason some rule fails, I don't want the deploy process to stop because of that. Hope this make sense. Again, if you are willing to add this functionality, I'll be glad to work in another PR, if the previous one doesn't satisfy you. Thanks for your time. |
Found this module for you: https://github.com/floriangosse/grunt-force-task |
We skip errors when first starting grunt but have them fail on a watch task. I will try out the linked module. It seems like a useful option when jscs and jshint both have it. It also doesn't add a lot of code. |
No description provided.