-
Notifications
You must be signed in to change notification settings - Fork 35
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
Values of constans wrapped in double quotes breaks JSHint #12
Comments
Whoops! thanks |
For now, may be good to ignore the generated file in your |
@ajwhite that's fine! Here is my workaround until we fix it: gulp.task('config', function() {
var env = argv.env ? argv.env : 'development';
gulp.src('conf/' + env + '.json')
.pipe(gulpNgConfig('cockpitUi.config', {
wrap: '(function () {\n\'use strict\';\n/*jshint ignore:start*/\n return <%= module %> /*jshint ignore:end*/\n})();'
}))
.pipe(rename('config.js'))
.pipe(gulp.dest('src/app/'));
}); Just ignore the rename and env hack, I did that so I could change among many configs easily. |
+1 for defaulting to single quotes. @jayrmotta's wrap solution worked for me. |
Placing on the roadmap |
Actually, just realized the PR was for double quotes, which broke your tests. Going to reopen for further consideration. A possibility would be to configure |
I would be OK with either one. Just would be nice to get rid of the warning for now.
|
Would it be that hard to transform "strings" to 'strings' during the JSON to JS process? Adding JSHint rules sounds more like a temporary workaround than a true solution to me. |
@wembernard yep, we'll be going with the |
@ajwhite I forked your project and managed to handle this by changing
to
However, I can't find a way to pass your |
The outputs have changed, so all the tests will fail. This should only happen if single quote property is provided |
exist a method or function to change the doublequotes to singlequote after gulp-ng-config? |
Activity: atticoos/issues/12 I ran into [this issue](atticoos/issues/12) as well where linters (Sonarlint in my case) take exception to the double-quotes output. I've changed the template and test files to use single-quotes and am using .replace on the template.constant.value to replace double-quotes with single-quotes. Tests pass.
Sounds pretty good to me! GJ! |
Hi, any news about this? I don't think an option for |
Any news? Thanks! :) |
Well, I just created a plugin that do the dirty job. You can find it here: https://www.npmjs.com/package/gulp-replace-quotes. It replace single quotes to double quotes or vice versa... |
A part of the strings on this file are written in single quotes and the other part is written in double quotes and it breaks JSHint validation.
Example:
The text was updated successfully, but these errors were encountered: