Skip to content

Commit 9feb5f6

Browse files
committed
Merge pull request #484 from XhmikosR/quotmark
Enable JSHint's `quotmark` rule.
2 parents 32d93f7 + 4369012 commit 9feb5f6

19 files changed

+166
-165
lines changed

.jshintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"noarg": true,
1010
"noempty": true,
1111
"nonbsp": true,
12+
"quotmark": "double",
1213
"undef": true,
1314
"globals": {
1415
"CSSLint": true,

Gruntfile.js

Lines changed: 122 additions & 122 deletions
Large diffs are not rendered by default.

src/cli/common.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ function cli(api){
171171
*/
172172
function outputHelp(){
173173
var lenToPad = 40,
174-
toPrint = '',
175-
formatString = '';
174+
toPrint = "",
175+
formatString = "";
176176

177177
api.print([
178178
"\nUsage: csslint-rhino.js [options]* [file|dir]*",
@@ -185,14 +185,14 @@ function cli(api){
185185
// Print the option name and the format if present
186186
toPrint += " --" + optionName;
187187
if (globalOptions[optionName].format !== "") {
188-
formatString = '=' + globalOptions[optionName].format;
188+
formatString = "=" + globalOptions[optionName].format;
189189
toPrint += formatString;
190190
} else {
191-
formatString = '';
191+
formatString = "";
192192
}
193193

194194
// Pad out with the appropriate number of spaces
195-
toPrint += new Array(lenToPad - (optionName.length + formatString.length)).join(' ');
195+
toPrint += new Array(lenToPad - (optionName.length + formatString.length)).join(" ");
196196

197197
// Print the description
198198
toPrint += globalOptions[optionName].description + "\n";
@@ -283,8 +283,8 @@ function cli(api){
283283

284284
function validateOptions(options) {
285285
for (var option_key in options) {
286-
if (!globalOptions.hasOwnProperty(option_key) && option_key !== 'files') {
287-
api.print(option_key + ' is not a valid option. Exiting...');
286+
if (!globalOptions.hasOwnProperty(option_key) && option_key !== "files") {
287+
api.print(option_key + " is not a valid option. Exiting...");
288288
outputHelp();
289289
api.quit(0);
290290
}

src/core/CSSLint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ var CSSLint = (function(){
179179
underscoreHack: true, strict: false });
180180

181181
// normalize line endings
182-
lines = text.replace(/\n\r?/g, "$split$").split('$split$');
182+
lines = text.replace(/\n\r?/g, "$split$").split("$split$");
183183

184184
if (!ruleset){
185185
ruleset = this.getRuleset();

src/formatters/checkstyle-xml.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@
8181
* @return rule source as {String}
8282
*/
8383
var generateSource = function(rule) {
84-
if (!rule || !('name' in rule)) {
84+
if (!rule || !("name" in rule)) {
8585
return "";
8686
}
87-
return 'net.csslint.' + rule.name.replace(/\s/g,'');
87+
return "net.csslint." + rule.name.replace(/\s/g,"");
8888
};
8989

9090

src/formatters/junit-xml.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ CSSLint.addFormatter({
3131
var messages = results.messages,
3232
output = [],
3333
tests = {
34-
'error': 0,
35-
'failure': 0
34+
"error": 0,
35+
"failure": 0
3636
};
3737

3838
/**
@@ -43,10 +43,10 @@ CSSLint.addFormatter({
4343
* @return rule source as {String}
4444
*/
4545
var generateSource = function(rule) {
46-
if (!rule || !('name' in rule)) {
46+
if (!rule || !("name" in rule)) {
4747
return "";
4848
}
49-
return 'net.csslint.' + rule.name.replace(/\s/g,'');
49+
return "net.csslint." + rule.name.replace(/\s/g,"");
5050
};
5151

5252
/**
@@ -76,15 +76,15 @@ CSSLint.addFormatter({
7676

7777
// since junit has no warning class
7878
// all issues as errors
79-
var type = message.type === 'warning' ? 'error' : message.type;
79+
var type = message.type === "warning" ? "error" : message.type;
8080

8181
//ignore rollups for now
8282
if (!message.rollup) {
8383

8484
// build the test case seperately, once joined
8585
// we'll add it to a custom array filtered by type
8686
output.push("<testcase time=\"0\" name=\"" + generateSource(message.rule) + "\">");
87-
output.push("<" + type + " message=\"" + escapeSpecialCharacters(message.message) + "\"><![CDATA[" + message.line + ':' + message.col + ':' + escapeSpecialCharacters(message.evidence) + "]]></" + type + ">");
87+
output.push("<" + type + " message=\"" + escapeSpecialCharacters(message.message) + "\"><![CDATA[" + message.line + ":" + message.col + ":" + escapeSpecialCharacters(message.evidence) + "]]></" + type + ">");
8888
output.push("</testcase>");
8989

9090
tests[type] += 1;

src/rules/bulletproof-font-face.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ CSSLint.addRule({
3939
col = event.col;
4040

4141
// This is the property that we care about, we can ignore the rest
42-
if (propertyName === 'src') {
42+
if (propertyName === "src") {
4343
var regex = /^\s?url\(['"].+\.eot\?.*['"]\)\s*format\(['"]embedded-opentype['"]\).*$/i;
4444

4545
// We need to handle the advanced syntax with two src properties

src/rules/compatible-vendor-prefixes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ CSSLint.addRule({
9090
for (prop in compatiblePrefixes) {
9191
if (compatiblePrefixes.hasOwnProperty(prop)) {
9292
variations = [];
93-
prefixed = compatiblePrefixes[prop].split(' ');
93+
prefixed = compatiblePrefixes[prop].split(" ");
9494
for (i = 0, len = prefixed.length; i < len; i++) {
95-
variations.push('-' + prefixed[i] + '-' + prop);
95+
variations.push("-" + prefixed[i] + "-" + prop);
9696
}
9797
compatiblePrefixes[prop] = variations;
9898
arrayPush.apply(applyTo, variations);

src/rules/duplicate-background-images.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ CSSLint.addRule({
2222

2323
if (name.match(/background/i)) {
2424
for (i=0, len=value.parts.length; i < len; i++) {
25-
if (value.parts[i].type == 'uri') {
26-
if (typeof stack[value.parts[i].uri] === 'undefined') {
25+
if (value.parts[i].type == "uri") {
26+
if (typeof stack[value.parts[i].uri] === "undefined") {
2727
stack[value.parts[i].uri] = event;
2828
}
2929
else {

src/rules/order-alphabetical.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ CSSLint.addRule({
3333
});
3434

3535
parser.addListener("endrule", function(event){
36-
var currentProperties = properties.join(','),
37-
expectedProperties = properties.sort().join(',');
36+
var currentProperties = properties.join(","),
37+
expectedProperties = properties.sort().join(",");
3838

3939
if (currentProperties !== expectedProperties){
4040
reporter.report("Rule doesn't have all its properties in alphabetical ordered.", event.line, event.col, rule);

0 commit comments

Comments
 (0)