aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Gaidarenko <markelog@gmail.com>2016-07-09 00:46:58 +0300
committerOleg Gaidarenko <markelog@gmail.com>2016-07-09 00:49:43 +0300
commit522f546d9607022a312cc30f8699c5282469f9a1 (patch)
tree40cb1e4e81ef38ba21a8f731f0148f67c71ff558
parent93f706200c6101df137469ba2e0d965e93508991 (diff)
downloadjquery-522f546d9607022a312cc30f8699c5282469f9a1.tar.gz
jquery-522f546d9607022a312cc30f8699c5282469f9a1.zip
Build: More ESLint related changes
-rw-r--r--.eslintrc4
-rw-r--r--dist/.eslintrc1
-rw-r--r--package.json2
-rw-r--r--src/attributes/prop.js8
-rw-r--r--src/css/showHide.js2
-rw-r--r--test/unit/core.js1
-rw-r--r--test/unit/manipulation.js2
7 files changed, 16 insertions, 4 deletions
diff --git a/.eslintrc b/.eslintrc
index 6dcb6353a..bbf96f809 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -3,5 +3,9 @@
"root": true,
"env": {
"node": true
+ },
+ rules: {
+ // Until https://github.com/jquery/eslint-config-jquery/issues/7 is resolved
+ "no-unused-expressions": "error"
}
}
diff --git a/dist/.eslintrc b/dist/.eslintrc
index c86665b21..22a970f8a 100644
--- a/dist/.eslintrc
+++ b/dist/.eslintrc
@@ -5,6 +5,7 @@
"no-multiple-empty-lines": "off",
// Because sizze is not compatible to jquery code style
+ "no-unused-expressions": "off",
"lines-around-comment": "off",
"space-in-parens": "off",
"camelcase": "off",
diff --git a/package.json b/package.json
index 3d38d9b74..6ef29dc0e 100644
--- a/package.json
+++ b/package.json
@@ -36,7 +36,7 @@
"grunt-compare-size": "0.4.2",
"grunt-contrib-uglify": "1.0.1",
"grunt-contrib-watch": "1.0.0",
- "grunt-eslint": "18.1.0",
+ "grunt-eslint": "19.0.0",
"grunt-git-authors": "3.2.0",
"grunt-jsonlint": "1.0.7",
"grunt-newer": "1.2.0",
diff --git a/src/attributes/prop.js b/src/attributes/prop.js
index 2f73a8508..b69177adf 100644
--- a/src/attributes/prop.js
+++ b/src/attributes/prop.js
@@ -88,9 +88,14 @@ jQuery.extend( {
// on the option
// The getter ensures a default option is selected
// when in an optgroup
+// eslint rule "no-unused-expressions" is disabled for this code
+// since it considers such accessions noop
if ( !support.optSelected ) {
jQuery.propHooks.selected = {
get: function( elem ) {
+
+ /* eslint no-unused-expressions: "off" */
+
var parent = elem.parentNode;
if ( parent && parent.parentNode ) {
parent.parentNode.selectedIndex;
@@ -98,6 +103,9 @@ if ( !support.optSelected ) {
return null;
},
set: function( elem ) {
+
+ /* eslint no-unused-expressions: "off" */
+
var parent = elem.parentNode;
if ( parent ) {
parent.selectedIndex;
diff --git a/src/css/showHide.js b/src/css/showHide.js
index 11b1479d9..3eeafef11 100644
--- a/src/css/showHide.js
+++ b/src/css/showHide.js
@@ -18,7 +18,7 @@ function getDefaultDisplay( elem ) {
return display;
}
- temp = doc.body.appendChild( doc.createElement( nodeName ) ),
+ temp = doc.body.appendChild( doc.createElement( nodeName ) );
display = jQuery.css( temp, "display" );
temp.parentNode.removeChild( temp );
diff --git a/test/unit/core.js b/test/unit/core.js
index 8c0f8640e..b00db8c33 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -1196,7 +1196,6 @@ QUnit.test( "jQuery.extend(Object, Object)", function( assert ) {
ret = jQuery.extend( true, { "foo": 4 }, { "foo": new MyNumber( 5 ) } );
assert.ok( parseInt( ret.foo, 10 ) === 5, "Wrapped numbers copy correctly" );
- nullUndef;
nullUndef = jQuery.extend( {}, options, { "xnumber2": null } );
assert.ok( nullUndef[ "xnumber2" ] === null, "Check to make sure null values are copied" );
diff --git a/test/unit/manipulation.js b/test/unit/manipulation.js
index b8fdb8e79..911852451 100644
--- a/test/unit/manipulation.js
+++ b/test/unit/manipulation.js
@@ -1359,7 +1359,7 @@ QUnit.test( "Empty replaceWith (trac-13401; trac-13596; gh-2204)", function( ass
assert.strictEqual( $el.html(), "", "replaceWith(" + label + ")" );
$el.html( "<b/>" ).children().replaceWith( function() { return input; } );
assert.strictEqual( $el.html(), "", "replaceWith(function returning " + label + ")" );
- $el.html( "<i/>" ).children().replaceWith( function( i ) { i; return input; } );
+ $el.html( "<i/>" ).children().replaceWith( function( i ) { return input; } );
assert.strictEqual( $el.html(), "", "replaceWith(other function returning " + label + ")" );
$el.html( "<p/>" ).children().replaceWith( function( i ) {
return i ?