Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var linter = require('eslint').linter
var Emitter = require('events').EventEmitter
var api = module.exports = new Emitter
var offsets
var lines
// ES6 feature options
var ecmaFeatures = require('./features')
// define our custom rule
linter.defineRule('autosemi', require('./rule'))
/**
* Process a file buffer with given options.
*
* @param {String} file - file to process
* @param {String} action - "add" or "remove"
* @param {Object} options
* @return {String}
*/
function process (file, action, options) {
// reset state
lines = file.split('\n')
offsets = {}
// lint
var ops = linter.verify(file, {
ConfigTester.prototype.defineRule = function(name, rule) {
linter.defineRule(name, rule);
};
fs.readdirSync(dir).forEach(function (file) {
if (file === cur) {
return;
}
var match = file.match(reg);
if (match) {
var key = 'fecs-' + match[1].replace(/[A-Z]/g, function (a) {
return '-' + a.toLowerCase();
});
eslint.defineRule(key, path.join(dir, file));
}
});
};