grunt-ng-constant icon indicating copy to clipboard operation
grunt-ng-constant copied to clipboard

Add useStrict option to configuration

Open mlegenhausen opened this issue 9 years ago • 6 comments

Proposal:

ngconstant: {
  options: {
    useStrict: true // Uses "'use strict'\n\n" as default value. Can be replaced by any string.
  }
}

All other definitions from template needs to be removed.

mlegenhausen avatar Feb 02 '15 14:02 mlegenhausen

:+1: as I get

src/common/config.js
      1 |"use strict";
         ^ Use the function form of "use strict".
      3 | angular.module('rest_config', [])
          ^ 'angular' is not defined.

artworkad avatar Nov 20 '15 15:11 artworkad

Which tool produces this error?

mlegenhausen avatar Nov 20 '15 15:11 mlegenhausen

@mlegenhausen Running "jshint:src" (jshint) task

artworkad avatar Nov 20 '15 15:11 artworkad

Do you use a custom template?

mlegenhausen avatar Nov 20 '15 15:11 mlegenhausen

@mlegenhausen nope, just this:

options: {
  space: '  ',
  wrap: '"use strict";\n\n {%= __ngModule %}',
  name: 'rest_config'
}

artworkad avatar Nov 20 '15 16:11 artworkad

Why do you not remove the "use strict" string from the wrap option?

mlegenhausen avatar Nov 20 '15 16:11 mlegenhausen