Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Clone in Desktop Download ZIP
43 lines (35 sloc) 872 Bytes
/**
* Requires placing line feed at file end.
*
* Type: `Boolean`
*
* Value: `true`
*
* #### Example
*
* ```js
* "requireLineFeedAtFileEnd": true
* ```
*/
var assert = require('assert');
module.exports = function() {};
module.exports.prototype = {
configure: function(options) {
assert(
options === true,
this.getOptionName() + ' option requires a true value or should be removed'
);
},
getOptionName: function() {
return 'requireLineFeedAtFileEnd';
},
check: function(file, errors) {
var lastToken = file.getLastToken();
var prevToken = file.getPrevToken(lastToken, {includeComments: true});
errors.assert.differentLine({
token: prevToken,
nextToken: lastToken,
message: 'Missing line feed at file end'
});
}
};
Jump to Line
Something went wrong with that request. Please try again.