},
"extends": "eslint:recommended",
"rules": {
+ "block-scoped-var": "error",
"brace-style": [
"error",
"stroustrup",
"allowSingleLine": true
}
],
+ "comma-spacing": "error",
+ "comma-style": [
+ "error",
+ "last"
+ ],
+ "curly": "error",
+ "eol-last": "error",
+ "eqeqeq": "error",
+ "indent": [
+ "error",
+ 2,
+ {
+ "SwitchCase": 1,
+ "VariableDeclarator": 2
+ }
+ ],
+ "key-spacing": [
+ "error",
+ {
+ "beforeColon": false,
+ "afterColon": true,
+ "mode": "minimum"
+ }
+ ],
+ "keyword-spacing": "error",
+ "new-parens": "error",
+ "no-array-constructor": "error",
"no-console": "off",
- "no-throw-literal": "error"
+ "no-floating-decimal": "error",
+ "no-lone-blocks": "error",
+ "no-lonely-if": "error",
+ "no-multiple-empty-lines": "error",
+ "no-multi-spaces": "error",
+ "no-new-object": "error",
+ "no-path-concat": "error",
+ "no-process-env": "error",
+ "no-return-assign": "error",
+ "no-self-compare": "error",
+ "no-sequences": "error",
+ "no-spaced-func": "error",
+ "no-throw-literal": "error",
+ "no-trailing-spaces": "error",
+ "no-unused-expressions": "error",
+ "no-useless-call": "error",
+ "no-useless-concat": "error",
+ "no-void": "error",
+ "object-curly-spacing": [
+ "error",
+ "always"
+ ],
+ "operator-assignment": [
+ "error",
+ "always"
+ ],
+ "quote-props": [
+ "error",
+ "as-needed"
+ ],
+ "quotes": [
+ "error",
+ "single"
+ ],
+ "semi": "error",
+ "semi-spacing": "error",
+ "space-before-blocks": "error",
+ "space-unary-ops": "error",
+ "spaced-comment": [
+ "error",
+ "always",
+ {
+ "markers": [
+ "!"
+ ]
+ }
+ ],
+ "wrap-iife": [
+ "error",
+ "inside"
+ ],
+ "yoda": "error"
}
}
minifyJS: byId('minify-js').checked,
processScripts: byId('minify-js-templates').checked ? byId('minify-js-templates-type').value : false,
minifyCSS: byId('minify-css').checked,
- minifyURLs: byId('minify-urls').checked ? { site:byId('minify-urls-siteurl').value } : false,
+ minifyURLs: byId('minify-urls').checked ? { site: byId('minify-urls-siteurl').value } : false,
lint: byId('use-htmllint').checked ? new HTMLLint() : null,
maxLineLength: parseInt(byId('max-line-length').value, 10)
};
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ ga.src = (document.location.protocol === 'https:' ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
document.getElementsByTagName('head')[0].appendChild(ga);
})();
}
});
}).end(querystring.stringify({
- code_type:'html',
+ code_type: 'html',
verbose: 1,
html_level: 1,
minimize_style: 1,
if (minified !== null) {
// Write the output
try {
+ // eslint-disable-next-line eqeqeq
if (output != null) {
fs.writeFileSync(path.resolve(output), minified);
}
name: name,
value: value,
customAssign: customAssign || '=',
- customOpen: customOpen || '',
+ customOpen: customOpen || '',
customClose: customClose || '',
quote: quote || ''
};
}
var elems = [],
- documentElement = doc.documentElement ||
- doc.getDocumentElement && doc.getDocumentElement();
+ documentElement = doc.documentElement ||
+ doc.getDocumentElement && doc.getDocumentElement();
// If we're dealing with an empty document then we
// need to pre-populate it with the HTML document structure
chars: function( text ) {
curParentNode.appendChild( doc.createTextNode( text ) );
},
- comment: function( /*text*/ ) {
+ comment: function( /* text */ ) {
// create comment node
},
ignore: function( /* text */ ) {
return minify(value, options);
};
-}(typeof exports === 'undefined' ? this : exports));
+})(typeof exports === 'undefined' ? this : exports);
/*!
* HTMLLint (to be used in conjunction with HTMLMinifier)
return minify(value, options);
};
-}(typeof exports === 'undefined' ? this : exports));
+})(typeof exports === 'undefined' ? this : exports);
name: name,
value: value,
customAssign: customAssign || '=',
- customOpen: customOpen || '',
+ customOpen: customOpen || '',
customClose: customClose || '',
quote: quote || ''
};
}
var elems = [],
- documentElement = doc.documentElement ||
- doc.getDocumentElement && doc.getDocumentElement();
+ documentElement = doc.documentElement ||
+ doc.getDocumentElement && doc.getDocumentElement();
// If we're dealing with an empty document then we
// need to pre-populate it with the HTML document structure
chars: function( text ) {
curParentNode.appendChild( doc.createTextNode( text ) );
},
- comment: function( /*text*/ ) {
+ comment: function( /* text */ ) {
// create comment node
},
ignore: function( /* text */ ) {
output = '<div><pRe>$foo = "baz";</pRe></div>';
equal(minify(input, { collapseWhitespace: true, caseSensitive: true }), output);
- input = '<script type=\"text\/javascript\">var = \"hello\";<\/script>\r\n\r\n\r\n' +
- '<style type=\"text\/css\">#foo { color: red; } <\/style>\r\n\r\n\r\n' +
- '<div>\r\n <div>\r\n <div><!-- hello -->\r\n <div>' +
- '<!--! hello -->\r\n <div>\r\n <div class=\"\">\r\n\r\n ' +
- '<textarea disabled=\"disabled\"> this is a textarea <\/textarea>\r\n ' +
- '<\/div>\r\n <\/div>\r\n <\/div>\r\n <\/div>\r\n <\/div>\r\n<\/div>' +
- '<pre> \r\nxxxx<\/pre><span>x<\/span> <span>Hello<\/span> <b>billy<\/b> \r\n' +
- '<input type=\"text\">\r\n<textarea><\/textarea>\r\n<pre><\/pre>';
- output = '<script type="text/javascript">var = "hello";</script>' +
- '<style type="text/css">#foo { color: red; }</style>' +
- '<div><div><div>' +
- '<!-- hello --><div><!--! hello --><div><div class="">' +
- '<textarea disabled="disabled"> this is a textarea </textarea>' +
- '</div></div></div></div></div></div>' +
- '<pre> \r\nxxxx</pre><span>x</span> <span>Hello</span> <b>billy</b> ' +
+ input = '<script type=\"text\/javascript\">var = \"hello\";<\/script>\r\n\r\n\r\n' +
+ '<style type=\"text\/css\">#foo { color: red; } <\/style>\r\n\r\n\r\n' +
+ '<div>\r\n <div>\r\n <div><!-- hello -->\r\n <div>' +
+ '<!--! hello -->\r\n <div>\r\n <div class=\"\">\r\n\r\n ' +
+ '<textarea disabled=\"disabled\"> this is a textarea <\/textarea>\r\n ' +
+ '<\/div>\r\n <\/div>\r\n <\/div>\r\n <\/div>\r\n <\/div>\r\n<\/div>' +
+ '<pre> \r\nxxxx<\/pre><span>x<\/span> <span>Hello<\/span> <b>billy<\/b> \r\n' +
+ '<input type=\"text\">\r\n<textarea><\/textarea>\r\n<pre><\/pre>';
+ output = '<script type="text/javascript">var = "hello";</script>' +
+ '<style type="text/css">#foo { color: red; }</style>'+
+ '<div><div><div>' +
+ '<!-- hello --><div><!--! hello --><div><div class="">' +
+ '<textarea disabled="disabled"> this is a textarea </textarea>' +
+ '</div></div></div></div></div></div>' +
+ '<pre> \r\nxxxx</pre><span>x</span> <span>Hello</span> <b>billy</b> ' +
'<input type="text"><textarea></textarea><pre></pre>';
equal(minify(input, { collapseWhitespace: true }), output);