Skip to content

Instantly share code, notes, and snippets.

@clouddueling
Created November 26, 2013 01:51
Show Gist options
  • Select an option

  • Save clouddueling/7652264 to your computer and use it in GitHub Desktop.

Select an option

Save clouddueling/7652264 to your computer and use it in GitHub Desktop.
config.js for lintyai brackets
define(function(require, exports){
////////////////////////////////////////////////////////////////////////////////
// http://jshint.com/
exports.javascript = {};
exports.javascript.cmd = '/usr/local/bin/node "%s/jshint/bin/jshint"';
exports.javascript.re = function(data){
var result = [];
data.split('\n').forEach(function(element){
var match;
element += '\n';
match = /^(.+): line (\d+), col (\d+), /.exec(element);
match && result.push({
line: match[2],
message: element.replace(match[0], '')
});
});
return result;
};
exports.javascript.type = {};
exports.javascript.type.warning = /(Missing\s|Unnecessary\s)/;
exports.javascript.type.notice = /\sbut never used/;
////////////////////////////////////////////////////////////////////////////////
// http://lesscss.org/
exports.css =
exports.less = {};
exports.css.cmd = '/usr/local/bin/node "%s/less/bin/lessc" -l --no-color';
exports.css.re = function(data){
var match = / in (.+) on line (\d+), column (\d+):/m.exec(data);
return {
line: match[2],
message: data.replace(match[0])
};
};
////////////////////////////////////////////////////////////////////////////////
// https://github.com/zaach/jsonlint/
exports.json = {};
exports.json.cmd = "/usr/local/bin/node '%s/jsonlint/lib/cli.js' -q";
exports.json.re = function(data){
var match = /(.+) on line (\d+):/.exec(data);
return {
line: match[2],
message: data.replace(match[0], '').trim().slice(0, -1)
};
};
////////////////////////////////////////////////////////////////////////////////
// http://php.net/
exports.php = {};
exports.php.cmd = '/Applications/MAMP/bin/php/php5.4.19/bin/php -d display_errors=1 -l';
exports.php.re = function(data){
var match = /(.+) in (.+) on line (\d+)/.exec(data);
if (data.indexOf('No syntax errors detected') == -1)
return {
line: match[3],
message: match[1]
};
};
////////////////////////////////////////////////////////////////////////////////
// http://lua.org/
exports.lua = {};
exports.lua.cmd = 'D:/bin/lang/lua/bin/luac -p';
exports.lua.re = function(data){
var match = /(.+): (.+):(\d+): /.exec(data);
return {
line: match[3],
message: data.replace(match[0], '')
};
};
////////////////////////////////////////////////////////////////////////////////
// http://xmlsoft.org/
exports.xml = {};
exports.xml.cmd = 'D:/bin/lang/xmllint/xmllint --noout --debug';
exports.xml.re = function(data){
var result = [];
data.split('^\r\n').forEach(function(element){
var match;
element += '^';
match = /^(.+):(\d+): /m.exec(element);
match && result.push({
line: match[2],
message: element.replace(match[0], '')
});
});
return result;
};
////////////////////////////////////////////////////////////////////////////////
// http://xmlsoft.org/
exports.html =
exports.htm = {};
exports.html.cmd = 'D:/bin/lang/xmllint/xmllint --noout --debug --html';
exports.html.re = exports.xml.re;
////////////////////////////////////////////////////////////////////////////////
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment