Skip to content
This repository has been archived by the owner on Sep 11, 2022. It is now read-only.

Some minor linting fixes and cleanup #173

Merged
merged 1 commit into from
Aug 18, 2015
Merged

Some minor linting fixes and cleanup #173

merged 1 commit into from
Aug 18, 2015

Conversation

acconrad
Copy link
Contributor

My team is using this plugin and I noticed a few places that needed to be cleaned up and optimized:

  1. A bunch of inconsistency with the use of strict equality (===). Strict equality should always be used when you're not dealing with falsey objects (i.e. null == undefined is permitted, so therefore obj == null or obj == undefined is permissible)
  2. There was a missing semicolon. Every other line ends with a semicolon, so that one needed one as well.
  3. A minor for loop optimization would be to cache the length of the for loop inside of a variable in the first portion of the loop. This saves having to call length every single time.While this is optimized in modern browsers, given you support legacy browsers, this is a worthwhile optimization.

My team is using this plugin and I noticed a few places that needed to be cleaned up and optimized:

1. A bunch of inconsistency with the use of strict equality (`===`). Strict equality should always be used when you're not dealing with falsey objects (i.e. `null == undefined` is permitted, so therefore `obj == null` or `obj == undefined` is permissible)
2. There was a missing semicolon. Every other line ends with a semicolon, so that one needed one as well.
3. A minor for loop optimization would be to cache the length of the for loop inside of a variable in the first portion of the loop. This saves having to call length every single time.While this is optimized in modern browsers, given you support legacy browsers, this is a worthwhile optimization.
garand added a commit that referenced this pull request Aug 18, 2015
Some minor linting fixes and cleanup
@garand garand merged commit a0154df into garand:master Aug 18, 2015
@garand
Copy link
Owner

garand commented Aug 18, 2015

Thanks for contributing! Glad you're enjoying the plugin.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants