mirror of
https://github.com/desandro/imagesloaded.git
synced 2026-01-09 14:38:02 -05:00
👔 lint eqeqeq error smart
This commit is contained in:
@@ -15,6 +15,7 @@ module.exports = {
|
||||
QUnit: 'readonly',
|
||||
},
|
||||
rules: {
|
||||
eqeqeq: [ 'error', 'smart' ],
|
||||
'id-length': [ 'error', {
|
||||
min: 2,
|
||||
max: 30,
|
||||
|
||||
@@ -94,7 +94,7 @@ const elementNodeTypes = [ 1, 9, 11 ];
|
||||
*/
|
||||
ImagesLoaded.prototype.addElementImages = function( elem ) {
|
||||
// filter siblings
|
||||
if ( elem.nodeName == 'IMG' ) {
|
||||
if ( elem.nodeName === 'IMG' ) {
|
||||
this.addImage( elem );
|
||||
}
|
||||
// get background image on element
|
||||
@@ -185,7 +185,7 @@ ImagesLoaded.prototype.progress = function( image, elem, message ) {
|
||||
this.jqDeferred.notify( this, image );
|
||||
}
|
||||
// check if completed
|
||||
if ( this.progressedCount == this.images.length ) {
|
||||
if ( this.progressedCount === this.images.length ) {
|
||||
this.complete();
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ LoadingImage.prototype.confirm = function( isLoaded, message ) {
|
||||
this.isLoaded = isLoaded;
|
||||
let { parentNode } = this.img;
|
||||
// emit progress with parent <picture> or self <img>
|
||||
let elem = parentNode.nodeName == 'PICTURE' ? parentNode : this.img;
|
||||
let elem = parentNode.nodeName === 'PICTURE' ? parentNode : this.img;
|
||||
this.emitEvent( 'progress', [ this, elem, message ] );
|
||||
};
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ QUnit.test( 'background', function( assert ) {
|
||||
assert.equal( imgLoad0.images.length, 1, '1 image on .images' );
|
||||
|
||||
imgLoad0.on( 'progress', function( instance, image, element ) {
|
||||
assert.ok( element.nodeName == 'DIV', 'progress; element is div' );
|
||||
assert.ok( element.nodeName === 'DIV', 'progress; element is div' );
|
||||
assert.ok( image.isLoaded, 'progress; image.isLoaded' );
|
||||
done();
|
||||
} );
|
||||
|
||||
@@ -9,7 +9,7 @@ QUnit.test( 'picture', function( assert ) {
|
||||
assert.equal( imgLoad0.images.length, 3, '3 images on #picture-list' );
|
||||
|
||||
imgLoad0.on( 'progress', function( instance, image, element ) {
|
||||
assert.ok( element.nodeName == 'PICTURE', 'progress; element is picture' );
|
||||
assert.ok( element.nodeName === 'PICTURE', 'progress; element is picture' );
|
||||
assert.ok( image.isLoaded, 'progress; image.isLoaded' );
|
||||
done();
|
||||
} );
|
||||
|
||||
@@ -9,7 +9,7 @@ QUnit.test( 'srcset', function( assert ) {
|
||||
assert.equal( imgLoad0.images.length, 3, '3 images on #srcset' );
|
||||
|
||||
imgLoad0.on( 'progress', function( instance, image, element ) {
|
||||
assert.ok( element.nodeName == 'IMG', 'progress; element is img' );
|
||||
assert.ok( element.nodeName === 'IMG', 'progress; element is img' );
|
||||
assert.ok( image.isLoaded, 'progress; image.isLoaded' );
|
||||
done();
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user