I have a problem while building the sources using Grunt, with JSLint task for error check:
L177: Expected a newline at the end of the file. Warning: Formatting check failed. Use --force to continue. Aborted due to warnings.
The problem is obvious, but I use also the Beautify plugin for Brackets from: https://github.com/drewhamlett/brackets-beautify which by default removes all the new lines from the end of file.
My configuration for JSLint task in Gruntfile.js
:
jslint: {
server: {
src: [
'<%= config.PATH %>/src/**/*.js',
],
directives: {
indent: 4,
plusplus: true,
unparam: true,
todo: true,
globals: [
'angular'
]
},
options: {
edition: 'latest', // specify an edition of jslint or use 'dir/mycustom-jslint.js' for own path
errorsOnly: true, // only display errors
failOnError: true // defaults to true
}
}
}
My question is, how to change the JSLint configuration in Gruntfile.js to ignore the newline at EOF or to force the Beautify plugin to add (or simply do not remove) the new lines at the end of file?
According to the Brackets Beautify Documentation, it uses JS-Beautify internally. The documentation for the latter mentions these parameters:
If you can force Adobe Brackets to pass parameters to the js-beautify call, I guess one of these should do the trick.
UPDATE
According to the Github repo, brackets beautify uses a
settings.json
internally for configuration. Addingmight be easier than hacking the command-line call.
2nd UPDATE
If I understand the README correctly, an extension is just a folder, so this should work: