Skip to content
This repository has been archived by the owner on Aug 4, 2020. It is now read-only.

Add no-await-in-loop rule. #22

Merged
merged 1 commit into from Nov 1, 2015
Merged

Add no-await-in-loop rule. #22

merged 1 commit into from Nov 1, 2015

Conversation

nmote
Copy link
Contributor

@nmote nmote commented Oct 19, 2015

Closes #20

@nmote
Copy link
Contributor Author

nmote commented Oct 26, 2015

Friendly ping @jquense @hzoo :)

"use strict";

// Node types which are considered loops.
var loopTypes = new Set([
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we actually use Set here since we don't know what version of node people are using?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a target minimum version? I can use an Object instead of necessary.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is nothing set in stone but I think we are mostly in keeping with eslint, which still supports 0.10.x i believe...my rule of thumb has been: es5

@nmote
Copy link
Contributor Author

nmote commented Oct 28, 2015

OK, I removed Sets. I'm not thrilled about iterating over an array to check membership, but I think since the depth of the AST is generally fairly small it shouldn't be a big problem. I used Objects where I could but as I said in the comments, that's not appropriate when the elements aren't strings. I'm happy to entertain other suggestions.

@jquense
Copy link
Contributor

jquense commented Nov 1, 2015

LGTM, I think the array will be fine, bc as you say the depth is not likely to be deep enough to make much of a difference.

If it does pose an issue I'd be happy to revisit using Set, I don't think it would be too much trouble to require node 0.12+ but lets see how it goes.

jquense added a commit that referenced this pull request Nov 1, 2015
Add no-await-in-loop rule.
@jquense jquense merged commit cd9b8aa into babel:master Nov 1, 2015
@jquense
Copy link
Contributor

jquense commented Nov 1, 2015

I'll try and get a release out in the next day or so

@nmote nmote deleted the await branch November 5, 2015 17:35
@nmote
Copy link
Contributor Author

nmote commented Nov 23, 2015

@jquense Any word on a release?

@jquense
Copy link
Contributor

jquense commented Nov 24, 2015

sorry about that, been a busy month thanks for the reminder

@nmote
Copy link
Contributor Author

nmote commented Nov 24, 2015

No worries, I know how it goes 😄

nicolo-ribaudo pushed a commit to babel/babel that referenced this pull request Nov 14, 2019
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.

None yet

3 participants