Skip to content

Commit 56a2a18

Browse files
committed
Build: Bump and merge JSHint/JSCS config
Moved options depreciated in the latest JSHint to the JSCS version.
1 parent cda5efa commit 56a2a18

File tree

8 files changed

+64
-40
lines changed

8 files changed

+64
-40
lines changed

.jscsrc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"preset": "jquery",
3+
"disallowSpacesInNamedFunctionExpression": {
4+
"beforeOpeningRoundBrace": true
5+
},
6+
"requireSpacesInNamedFunctionExpression": {
7+
"beforeOpeningCurlyBrace": true
8+
},
9+
"disallowSpacesInAnonymousFunctionExpression": {
10+
"beforeOpeningRoundBrace": true
11+
},
12+
"requireSpacesInAnonymousFunctionExpression": {
13+
"beforeOpeningCurlyBrace": true
14+
},
15+
"disallowTrailingComma": true,
16+
"requireMultipleVarDecl": "onevar",
17+
"disallowTrailingWhitespace": true,
18+
"validateQuoteMarks": "\"",
19+
"excludeFiles": [
20+
"node_modules/**",
21+
"dist/**"
22+
]
23+
}

.jshintrc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@
66
"expr": true,
77
"immed": true,
88
"noarg": true,
9-
"onevar": true,
10-
"quotmark": "double",
11-
"smarttabs": true,
12-
"trailing": true,
139
"undef": true,
1410
"unused": true,
11+
"es3": true,
1512

1613
"jquery": true,
1714
"browser": true,

Gruntfile.js

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -118,22 +118,20 @@ grunt.initConfig({
118118
options: {
119119
jshintrc: true
120120
},
121-
files: [
122-
"src/**/*.js"
123-
],
121+
core: {
122+
src: [
123+
"src/**/*.js"
124+
]
125+
},
124126
test: {
125-
files: {
126-
src: [
127-
"test/*.js"
128-
]
129-
}
127+
src: [
128+
"test/*.js"
129+
]
130130
},
131131
grunt: {
132-
files: {
133-
src: [
134-
"Gruntfile.js"
135-
]
136-
}
132+
src: [
133+
"Gruntfile.js"
134+
]
137135
}
138136
},
139137
watch: {
@@ -142,20 +140,20 @@ grunt.initConfig({
142140
tasks: ["jshint:grunt"]
143141
},
144142
src: {
145-
files: "<%= jshint.files %>",
146-
tasks: ["concat", "qunit"]
143+
files: "<%= jshint.core.src %>",
144+
tasks: ["jscs:core", "jshint:core", "concat", "qunit"]
147145
},
148146
test: {
149-
files: ["<%= jshint.test.files.src %>", "test/index.html"],
150-
tasks: ["jshint:test"]
147+
files: ["<%= jshint.test.src %>", "test/index.html"],
148+
tasks: ["jscs:test", "jshint:test"]
151149
}
152150
},
153151
jscs: {
154-
all: {
155-
options: {
156-
preset: "jquery"
157-
},
158-
src: "src/**/*.*"
152+
core: {
153+
src: "<%= jshint.core.src %>"
154+
},
155+
test: {
156+
src: "<%= jshint.test.src %>"
159157
}
160158
},
161159
copy: {

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
"devDependencies": {
3030
"commitplease": "1.7.0",
3131
"grunt": "0.4.4",
32+
"grunt-contrib-compress": "0.7.0",
33+
"grunt-contrib-concat": "0.3.0",
34+
"grunt-contrib-copy": "0.5.0",
35+
"grunt-contrib-jshint": "^0.10.0",
3236
"grunt-contrib-qunit": "0.4.0",
33-
"grunt-contrib-jshint": "0.8.0",
3437
"grunt-contrib-uglify": "0.4.0",
35-
"grunt-contrib-concat": "0.3.0",
36-
"grunt-contrib-compress": "0.7.0",
3738
"grunt-contrib-watch": "0.6.0",
38-
"grunt-jscs-checker": "0.4.0",
39-
"grunt-contrib-copy": "0.5.0",
39+
"grunt-jscs-checker": "^0.4.4",
4040
"grunt-text-replace": "0.3.11"
4141
},
4242
"keywords": [

src/additional/dateITA.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ $.validator.addMethod("dateITA", function(value, element) {
2727
mm = parseInt(adata[1],10);
2828
aaaa = parseInt(adata[2],10);
2929
xdata = new Date(aaaa, mm - 1, gg, 12, 0, 0, 0);
30-
if ( ( xdata.getFullYear() === aaaa ) && ( xdata.getMonth() === mm - 1 ) && ( xdata.getDate() === gg ) ){
30+
if ( ( xdata.getFullYear() === aaaa ) && ( xdata.getMonth() === mm - 1 ) && ( xdata.getDate() === gg ) ) {
3131
check = true;
3232
} else {
3333
check = false;

src/additional/vinUS.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $.validator.addMethod("vinUS", function(v) {
2121
rs = 0,
2222
i, n, d, f, cd, cdv;
2323

24-
for (i = 0; i < 17; i++){
24+
for (i = 0; i < 17; i++) {
2525
f = FL[i];
2626
d = v.slice(i,i + 1);
2727
if (i === 8) {

src/core.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,17 @@ $.extend($.fn, {
177177
// Custom selectors
178178
$.extend( $.expr[ ":" ], {
179179
// http://jqueryvalidation.org/blank-selector/
180-
blank: function( a ) { return !$.trim( "" + $( a ).val() ); },
180+
blank: function( a ) {
181+
return !$.trim( "" + $( a ).val() );
182+
},
181183
// http://jqueryvalidation.org/filled-selector/
182-
filled: function( a ) { return !!$.trim( "" + $( a ).val() ); },
184+
filled: function( a ) {
185+
return !!$.trim( "" + $( a ).val() );
186+
},
183187
// http://jqueryvalidation.org/unchecked-selector/
184-
unchecked: function( a ) { return !$( a ).prop( "checked" ); }
188+
unchecked: function( a ) {
189+
return !$( a ).prop( "checked" );
190+
}
185191
});
186192

187193
// constructor for validator
@@ -730,7 +736,7 @@ $.extend( $.validator, {
730736
.attr( "id", elementID + "-error" )
731737
.addClass( this.settings.errorClass )
732738
.html( message || "" );
733-
739+
734740
// Maintain reference to the element to be placed into the DOM
735741
place = error;
736742
if ( this.settings.wrapper ) {
@@ -745,7 +751,7 @@ $.extend( $.validator, {
745751
} else {
746752
place.insertAfter( element );
747753
}
748-
754+
749755
// Link error back to the element
750756
if ( error.is( "label" ) ) {
751757
// If the error is a label, then associate using 'for'
@@ -754,7 +760,7 @@ $.extend( $.validator, {
754760
// If the element is not a child of an associated label, then it's necessary
755761
// to explicitly apply aria-describedby
756762
$( element ).attr( "aria-describedby", error.attr( "id" ) );
757-
763+
758764
// If this element is grouped, then assign to all elements in the same group
759765
group = this.groups[ element.name ];
760766
if ( group ) {

src/localization/messages_fr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ $.extend($.validator.messages, {
4545
nifES: "Veuillez fournir un numéro NIF valide.",
4646
nieES: "Veuillez fournir un numéro NIE valide.",
4747
cifES: "Veuillez fournir un numéro CIF valide.",
48-
postalCodeCA: "Veuillez fournir un code postal valide.",
48+
postalCodeCA: "Veuillez fournir un code postal valide."
4949
});

0 commit comments

Comments
 (0)