Skip to content
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

Closed
wants to merge 1 commit into from
Closed

force flag #55

wants to merge 1 commit into from

Conversation

bessdsv
Copy link

@bessdsv bessdsv commented Mar 6, 2015

No description provided.

@sindresorhus
Copy link
Owner

Why? And you have a merge conflict.

@bessdsv
Copy link
Author

bessdsv commented Mar 7, 2015

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.

@sindresorhus
Copy link
Owner

You can already do that with the --force flag. grunt --force.

@sindresorhus sindresorhus mentioned this pull request Mar 9, 2015
@etylsarin
Copy link

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?

@sindresorhus
Copy link
Owner

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? ;)

https://github.com/gruntjs/grunt/issues/new

@etylsarin
Copy link

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
And I would really like to switch from jshint to eslint on our projects but I can't as used linting tool must not break the build process.

@kokarn
Copy link

kokarn commented Sep 11, 2015

I agree with @sindresorhus in principle but the option to don't break on error is something that is really helpful.

👍 if it matters

@rafayepes
Copy link

@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

@sindresorhus
Copy link
Owner

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.

@rafayepes
Copy link

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.

@sindresorhus sindresorhus mentioned this pull request Oct 17, 2015
@sindresorhus
Copy link
Owner

Found this module for you: https://github.com/floriangosse/grunt-force-task

@sindresorhus sindresorhus mentioned this pull request Dec 9, 2015
@steveoh
Copy link

steveoh commented Dec 9, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants