I have created a new service with Grunt using the angular-generator and then reformatted the code with WebStorm Ctrl+ALT+L
First, you should configure WebStorm to use the same JSHint file as Grunt.
Go to Project Settings -> Javascript -> Code Quality Tools -> JSHint
click Enable
and reference to the .jshintrc
in your Project.
Second, you should add this two lines of code at the top of all your JavaScript files:
/* global angular */
'use strict';