You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if there was an ability to add the disable jscs check comment on the constant generated file as I follow the airbnb javascript convention of using single quotes for strings rather than double quotes (which is the standard for json).
The text was updated successfully, but these errors were encountered:
Hi, we haven't come up with a good solution for outputting single quotes. But as a quick workaround you can disable the validation for this file in your .jscsignore or using a custom template that wraps the output in comments that disable the jscs validation.
Here is a small piece of code you can add to your config to replace all double quotes with single quotes. (Though be careful because it will mess up your config options if any of them contain double quotes.)
gulp.task('config', function () {
gulp.src('app/config.json')
.pipe(ngConstant({
// ngConstant options
}))
// change double quotes to single quotes
// or you can add jshint ignore instead
.pipe(replace(/"/g, '\''))
.pipe(gulp.dest('dist'));
});
You will also need var replace = require('gulp-replace'); at the top of your file and "gulp-replace": "~0.5.3", in your package.json.
Also, don't forget to run npm install after editing package.json.
It would be great if there was an ability to add the disable jscs check comment on the constant generated file as I follow the airbnb javascript convention of using single quotes for strings rather than double quotes (which is the standard for json).
The text was updated successfully, but these errors were encountered: