Skip to content

Commit

Permalink
Build: More ESLint related changes
Browse files Browse the repository at this point in the history
  • Loading branch information
markelog committed Jul 8, 2016
1 parent 93f7062 commit 522f546
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
1 change: 1 addition & 0 deletions dist/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 8 additions & 0 deletions src/attributes/prop.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,24 @@ 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;
}
return null;
},
set: function( elem ) {

/* eslint no-unused-expressions: "off" */

var parent = elem.parentNode;
if ( parent ) {
parent.selectedIndex;
Expand Down
2 changes: 1 addition & 1 deletion src/css/showHide.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
1 change: 0 additions & 1 deletion test/unit/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" );

Expand Down
2 changes: 1 addition & 1 deletion test/unit/manipulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?
Expand Down

0 comments on commit 522f546

Please sign in to comment.