Skip to content
This repository was archived by the owner on Nov 15, 2017. It is now read-only.

Commit b106a0e

Browse files
committed
Move JSHint config to jshintrc files
Follows-up 3f1f88b. Also: * Moved jquery.cookie.js to src/ directory to allow using a separate configuration for it (also complements /build, and other jQuery plugin repositories). * Simplified Grunt configuration.
1 parent be47cde commit b106a0e

10 files changed

Lines changed: 49 additions & 57 deletions

File tree

.jshintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build
2+
node_modules

.jshintrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"curly": true,
3+
"eqeqeq": true,
4+
"expr": true,
5+
// "maxlen": 130,
6+
"newcap": true,
7+
"noarg": true,
8+
"nonbsp": true,
9+
"trailing": true,
10+
"undef": true,
11+
"unused": true
12+
}

Gruntfile.js

Lines changed: 9 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,42 @@
1+
/*jshint node:true, quotmark:single */
12
'use strict';
23

34
module.exports = function (grunt) {
45

56
grunt.initConfig({
67
pkg: grunt.file.readJSON('package.json'),
78
qunit: {
8-
all: ['test/index.html']
9+
all: 'test/index.html'
910
},
1011
jshint: {
1112
options: {
12-
curly: true,
13-
eqeqeq: true,
14-
expr: true,
15-
// maxlen: 130,
16-
newcap: true,
17-
noarg: true,
18-
nonbsp: true,
19-
trailing: true,
20-
undef: true,
21-
unused: true
13+
jshintrc: true
2214
},
23-
grunt: {
24-
options: {
25-
node: true,
26-
quotmark: 'single'
27-
},
28-
files: {
29-
src: ['Gruntfile.js']
30-
}
31-
},
32-
source: {
33-
options: {
34-
browser: true,
35-
camelcase: true,
36-
jquery: true,
37-
quotmark: 'single',
38-
globals: {
39-
define: true,
40-
require: true
41-
},
42-
},
43-
files: {
44-
src: ['jquery.cookie.js']
45-
}
46-
},
47-
tests: {
48-
options: {
49-
browser: true,
50-
jquery: true,
51-
qunit: true,
52-
'-W053': true
53-
},
54-
files: {
55-
src: ['test/**/*.js']
56-
}
57-
}
15+
grunt: 'Gruntfile.js',
16+
source: 'src/**/*.js',
17+
tests: 'test/**/*.js'
5818
},
5919
uglify: {
6020
options: {
6121
banner: '/*! <%= pkg.name %> v<%= pkg.version %> | <%= pkg.license %> */\n'
6222
},
6323
build: {
6424
files: {
65-
'build/jquery.cookie-<%= pkg.version %>.min.js': 'jquery.cookie.js'
25+
'build/jquery.cookie-<%= pkg.version %>.min.js': 'src/jquery.cookie.js'
6626
}
6727
}
6828
},
6929
watch: {
7030
options: {
7131
livereload: true
7232
},
73-
files: [
74-
'jquery.cookie.js',
75-
'test/**/*.js'
76-
],
33+
files: '{src,test}/**/*.js',
7734
tasks: 'default'
7835
},
7936
compare_size: {
8037
files: [
8138
'build/jquery.cookie-<%= pkg.version %>.min.js',
82-
'jquery.cookie.js'
39+
'src/jquery.cookie.js'
8340
],
8441
options: {
8542
compress: {

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "jquery.cookie",
33
"version": "1.4.1",
44
"main": [
5-
"./jquery.cookie.js"
5+
"src/jquery.cookie.js"
66
],
77
"dependencies": {
88
"jquery": ">=1.2"

component.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"dependencies": {},
88
"development": {},
99
"license": "MIT",
10-
"main": "jquery.cookie.js",
10+
"main": "src/jquery.cookie.js",
1111
"scripts": [
12-
"jquery.cookie.js"
12+
"src/jquery.cookie.js"
1313
]
1414
}

src/.jshintrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"browser": true,
3+
"camelcase": true,
4+
"jquery": true,
5+
"quotmark": "single",
6+
"globals": {
7+
"define": true,
8+
"require": true
9+
},
10+
11+
"extends": "../.jshintrc"
12+
}
File renamed without changes.

test/.jshintrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"browser": true,
3+
"jquery": true,
4+
"qunit": true,
5+
6+
"-W053": true,
7+
8+
"extends": "../.jshintrc"
9+
}

test/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.14.0.css">
77
<script src="http://code.jquery.com/qunit/qunit-1.14.0.js"></script>
88
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
9-
<script src="../jquery.cookie.js"></script>
9+
<script src="../src/jquery.cookie.js"></script>
1010
<script src="tests.js"></script>
1111
</head>
1212
<body>

test/malformed_cookie.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<title></title>
55
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
6-
<script src="../jquery.cookie.js"></script>
6+
<script src="../src/jquery.cookie.js"></script>
77
<script>
88
try {
99
Object.defineProperty(document, "cookie", { get: function() { return "first=one; ; second=two"; } });

0 commit comments

Comments
 (0)