Skip to content

Commit

Permalink
👔 lint eqeqeq error smart
Browse files Browse the repository at this point in the history
  • Loading branch information
desandro committed Feb 19, 2022
1 parent b7181ac commit c4ff21a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
QUnit: 'readonly',
},
rules: {
eqeqeq: [ 'error', 'smart' ],
'id-length': [ 'error', {
min: 2,
max: 30,
Expand Down
6 changes: 3 additions & 3 deletions imagesloaded.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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 ] );
};

Expand Down
2 changes: 1 addition & 1 deletion test/unit/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
} );
Expand Down
2 changes: 1 addition & 1 deletion test/unit/picture.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
} );
Expand Down
2 changes: 1 addition & 1 deletion test/unit/srcset.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
} );
Expand Down

0 comments on commit c4ff21a

Please sign in to comment.