JSHint behave differently in Webstorm and Grunt

后端 未结 1 1139
旧巷少年郎
旧巷少年郎 2021-01-07 07:24

I have created a new service with Grunt using the angular-generator and then reformatted the code with WebStorm Ctrl+ALT+L

相关标签:
1条回答
  • 2021-01-07 07:58

    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';
    
    0 讨论(0)
提交回复
热议问题