--- In jslint_com@yahoogroups.com, "christian.wirkus" <christian.wirkus@...>
wrote:
>
> Hello!
> I think really neat would be something that generates the
> jslint-options-string (/*jslint ... */).
Hello!
I think really neat would be something that generates the
jslint-options-string (/*jslint ... */).
I am writing a small Javascript Library and had the good-parts
and the assume-a-browser in my jslint-options; now I learned
the good-parts have altered and I manually changed the string.
I wrote myself this method to run in the js-console to get the
checked options more convenient.
var getJSLintOptions = function () {
var result = [],
walkTheDom = function walk(node, func) {
func(node);
node = node.firstChild;
while (node) {
walk(node, func);
node = node.nextSibling;
}
};
walkTheDom(document.getElementById("options"), function (node) {
var nodeName = node.nodeName.toLowerCase(),
id, type;
if (nodeName === "input") {
id = node.getAttribute("id");
type = node.getAttribute("type");
if (type === "checkbox" && node.checked) {
result.push(id + ": true");
}
if (type === "text" && node.value) {
result.push(id + ": " + node.value);
}
}
});