Build: More ESLint related changes

This commit is contained in:
Oleg Gaidarenko
2016-07-09 00:46:58 +03:00
parent 93f706200c
commit 522f546d96
7 changed files with 16 additions and 4 deletions

View File

@@ -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
dist/.eslintrc vendored
View File

@@ -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",

View File

@@ -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",

View File

@@ -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;

View File

@@ -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 );

View File

@@ -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" );

View File

@@ -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 ?