Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
5dd8a90f
Commit
5dd8a90f
authored
Nov 25, 2012
by
Timo Tijhof
Committed by
Richard Gibson
Dec 06, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make compatible with jshint, lint test/data. Close gh-1043.
parent
26bf8dd5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
111 additions
and
118 deletions
+111
-118
.jshintrc
.jshintrc
+12
-14
grunt.js
grunt.js
+11
-5
.jshintrc
src/.jshintrc
+22
-30
.jshintignore
test/.jshintignore
+3
-0
.jshintrc
test/.jshintrc
+53
-59
test.js
test/data/test.js
+1
-1
testinit.js
test/data/testinit.js
+2
-2
testrunner.js
test/data/testrunner.js
+7
-7
No files found.
.jshintrc
View file @
5dd8a90f
{
{
"options": {
"curly": true,
"curly": true,
"eqeqeq": true,
"eqeqeq": true,
"latedef": true,
"eqnull": true,
"noarg": true,
"expr": true,
"noempty": true,
"latedef": true,
"quotmark": "double",
"noarg": true,
"undef": true,
"node": true,
"unused": true,
"quotmark": "double",
"strict": true,
"smarttabs": true,
"trailing": true,
"trailing": true,
"undef": true,
"node": true
"unused": true
}
}
}
grunt.js
View file @
5dd8a90f
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
* Resources
* Resources
*
*
* https://gist.github.com/2489540
* https://gist.github.com/2489540
*
*/
*/
module
.
exports
=
function
(
grunt
)
{
module
.
exports
=
function
(
grunt
)
{
...
@@ -82,7 +81,8 @@ module.exports = function( grunt ) {
...
@@ -82,7 +81,8 @@ module.exports = function( grunt ) {
lint
:
{
lint
:
{
dist
:
"dist/jquery.js"
,
dist
:
"dist/jquery.js"
,
grunt
:
"grunt.js"
,
grunt
:
"grunt.js"
,
tests
:
"test/unit/**/*.js"
// TODO: Once .jshintignore is supported, use that instead.
tests
:
[
"test/data/{test,testinit,testrunner}.js"
,
"test/unit/**/*.js"
]
},
},
jshint
:
(
function
()
{
jshint
:
(
function
()
{
...
@@ -91,9 +91,15 @@ module.exports = function( grunt ) {
...
@@ -91,9 +91,15 @@ module.exports = function( grunt ) {
}
}
return
{
return
{
grunt
:
jshintrc
(),
grunt
:
{
dist
:
jshintrc
(
"src/"
),
options
:
jshintrc
()
tests
:
jshintrc
(
"test/"
)
},
dist
:
{
options
:
jshintrc
(
"src/"
)
},
tests
:
{
options
:
jshintrc
(
"test/"
)
}
};
};
})(),
})(),
...
...
src/.jshintrc
View file @
5dd8a90f
{
{
"options": {
"curly": true,
"browser": true,
"expr": true,
"curly": true,
"newcap": false,
"eqnull": true,
"quotmark": "double",
"evil": true,
"regexdash": true,
"expr": true,
"strict": true,
"maxerr": 100,
"trailing": true,
"newcap": false,
"undef": true,
"quotmark": "double",
"unused": true,
"regexdash": true,
"maxerr": 100,
"strict": true,
"sub": true,
"eqnull": true,
"trailing": true,
"evil": true,
"undef": true,
"sub": true,
"unused": true,
"wsh": true
"browser": true,
},
"wsh": true,
"globals": {
"define": true,
"predef": [
"DOMParser": true,
"define",
"__dirname": true,
"jQuery"
"jQuery": true,
]
"global": true,
"module": true,
"exports": true,
"require": true,
"file": true,
"log": true,
"console": true
}
}
}
test/.jshintignore
0 → 100644
View file @
5dd8a90f
qunit/
data/badjson.js
data/jquery-1.8.2.ajax_xhr.min.js
test/.jshintrc
View file @
5dd8a90f
{
{
"options": {
"curly": true,
"browser": true,
"expr": true,
"curly": true,
"quotmark": "double",
"devel": true,
"trailing": true,
"eqnull": true,
"undef": true,
"evil": true,
"maxerr": 100,
"expr": true,
"maxerr": 100,
"eqnull": true,
"quotmark": "double",
"evil": true,
"smarttabs": true,
"smarttabs": true,
"sub": true,
"sub": true,
"trailing": true,
"undef": true,
"browser": true,
"wsh": true
"devel": true,
},
"wsh": true,
"globals": {
"define": true,
"predef": [
"DOMParser": true,
"DOMParser",
"__dirname": true,
"jQuery",
"jQuery": true,
"QUnit",
"global": true,
"module",
"module": true,
"ok",
"exports": true,
"equal",
"require": true,
"test",
"file": true,
"asyncTest",
"log": true,
"notEqual",
"QUnit": true,
"deepEqual",
"ok": true,
"strictEqual",
"equal": true,
"notStrictEqual",
"test": true,
"start",
"asyncTest": true,
"stop",
"notEqual": true,
"expect",
"deepEqual": true,
"raises",
"strictEqual": true,
"ajaxTest",
"notStrictEqual": true,
"testIframe",
"start": true,
"testIframeWithCallback",
"stop": true,
"createDashboardXML",
"expect": true,
"createXMLFragment",
"raises": true,
"moduleTeardown",
"ajaxTest": true,
"testFoo",
"testIframe": true,
"url",
"testIframeWithCallback": true,
"t",
"createDashboardXML": true,
"q",
"createXMLFragment": true,
"amdDefined",
"moduleTeardown": true,
"fireNative",
"testFoo": true,
"Globals",
"url": true,
"hasPHP",
"t": true,
"isLocal",
"q": true,
"originaljQuery",
"amdDefined": true,
"$",
"fireNative": true,
"original$",
"Globals": true,
"externalHost"
"hasPHP": true,
]
"isLocal": true,
"originaljQuery": true,
"$": true,
"original$": true,
"externalHost": true
}
}
}
test/data/test.js
View file @
5dd8a90f
var
testBar
=
"bar"
;
var
testBar
=
"bar"
;
jQuery
(
'#ap'
).
html
(
'bar'
);
jQuery
(
"#ap"
).
html
(
"bar"
);
ok
(
true
,
"test.js executed"
);
ok
(
true
,
"test.js executed"
);
test/data/testinit.js
View file @
5dd8a90f
/*jshint multistr:true */
/*jshint multistr:true
, quotmark:false
*/
var
amdDefined
,
fireNative
,
var
amdDefined
,
fireNative
,
originaljQuery
=
this
.
jQuery
||
"jQuery"
,
originaljQuery
=
this
.
jQuery
||
"jQuery"
,
...
@@ -207,7 +207,7 @@ function ajaxTest( title, expect, options ) {
...
@@ -207,7 +207,7 @@ function ajaxTest( title, expect, options ) {
}
}
};
};
});
});
}
;
}
(
function
()
{
(
function
()
{
...
...
test/data/testrunner.js
View file @
5dd8a90f
...
@@ -232,7 +232,7 @@ var Globals = (function() {
...
@@ -232,7 +232,7 @@ var Globals = (function() {
// Since this method was called it means some data was
// Since this method was called it means some data was
// expected to be found, but since there is nothing, fail early
// expected to be found, but since there is nothing, fail early
// (instead of in teardown).
// (instead of in teardown).
notStrictEqual
(
expando
,
undefined
,
'Target for expectJqData must have an expando, for else there can be no data to expect.'
);
notStrictEqual
(
expando
,
undefined
,
"Target for expectJqData must have an expando, for else there can be no data to expect."
);
}
else
{
}
else
{
if
(
expectedDataKeys
[
expando
]
)
{
if
(
expectedDataKeys
[
expando
]
)
{
expectedDataKeys
[
expando
].
push
(
key
);
expectedDataKeys
[
expando
].
push
(
key
);
...
@@ -243,9 +243,9 @@ var Globals = (function() {
...
@@ -243,9 +243,9 @@ var Globals = (function() {
}
}
};
};
QUnit
.
config
.
urlConfig
.
push
(
{
QUnit
.
config
.
urlConfig
.
push
(
{
id
:
'jqdata'
,
id
:
"jqdata"
,
label
:
'Always check jQuery.data'
,
label
:
"Always check jQuery.data"
,
tooltip
:
'Trigger "QUnit.expectJqData" detection for all tests instead of just the ones that call it'
tooltip
:
"Trigger QUnit.expectJqData detection for all tests instead of just the ones that call it"
}
);
}
);
/**
/**
...
@@ -265,14 +265,14 @@ var Globals = (function() {
...
@@ -265,14 +265,14 @@ var Globals = (function() {
expectedKeys
=
expectedDataKeys
[
i
];
expectedKeys
=
expectedDataKeys
[
i
];
actualKeys
=
jQuery
.
cache
[
i
]
?
keys
(
jQuery
.
cache
[
i
]
)
:
jQuery
.
cache
[
i
];
actualKeys
=
jQuery
.
cache
[
i
]
?
keys
(
jQuery
.
cache
[
i
]
)
:
jQuery
.
cache
[
i
];
if
(
!
QUnit
.
equiv
(
expectedKeys
,
actualKeys
)
)
{
if
(
!
QUnit
.
equiv
(
expectedKeys
,
actualKeys
)
)
{
deepEqual
(
actualKeys
,
expectedKeys
,
'Expected keys exist in jQuery.cache'
);
deepEqual
(
actualKeys
,
expectedKeys
,
"Expected keys exist in jQuery.cache"
);
}
}
delete
jQuery
.
cache
[
i
];
delete
jQuery
.
cache
[
i
];
delete
expectedDataKeys
[
i
];
delete
expectedDataKeys
[
i
];
}
}
// In case it was removed from cache before (or never there in the first place)
// In case it was removed from cache before (or never there in the first place)
for
(
i
in
expectedDataKeys
)
{
for
(
i
in
expectedDataKeys
)
{
deepEqual
(
expectedDataKeys
[
i
],
undefined
,
'No unexpected keys were left in jQuery.cache (#'
+
i
+
')'
);
deepEqual
(
expectedDataKeys
[
i
],
undefined
,
"No unexpected keys were left in jQuery.cache (#"
+
i
+
")"
);
delete
expectedDataKeys
[
i
];
delete
expectedDataKeys
[
i
];
}
}
}
}
...
@@ -359,5 +359,5 @@ QUnit.config.requireExpects = true;
...
@@ -359,5 +359,5 @@ QUnit.config.requireExpects = true;
return
;
return
;
}
}
document
.
write
(
"<scr"
+
"ipt src='http://swarm.jquery.org/js/inject.js?"
+
(
new
Date
).
getTime
()
+
"'></scr"
+
"ipt>"
);
document
.
write
(
"<scr"
+
"ipt src='http://swarm.jquery.org/js/inject.js?"
+
(
new
Date
()
).
getTime
()
+
"'></scr"
+
"ipt>"
);
})();
})();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment