Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support named imports and destructured requires #232

Merged
merged 4 commits into from
Sep 16, 2019

Conversation

alexzherdev
Copy link
Contributor

Fixes #121

@@ -19,9 +19,66 @@ const avaImportDeclarationAst = {
type: 'Literal',
value: 'ava'
}
};
}, {
type: 'ImportDeclaration',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not happy with the wall of ASTs... any way to make this easier to comprehend?

Copy link
Member

Choose a reason for hiding this comment

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

You might have been able to reduce the amount of AST code if you did the checks programmatically instead of comparing the AST tree, but that will also be more fragile and IMHO less readable, so I think this is fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

Some comments here and there to define what each AST match against could help.

@alexzherdev
Copy link
Contributor Author

Tested this locally in a random rule test. Should we create a dedicated test for create-ava-rule.js?

create-ava-rule.js Outdated Show resolved Hide resolved
@sindresorhus
Copy link
Member

Tested this locally in a random rule test. Should we create a dedicated test for create-ava-rule.js?

Yes, this needs to be tested.

@sindresorhus
Copy link
Member

@alexzherdev Would you be willing to help review some of the other PRs? 🙏

@alexzherdev
Copy link
Contributor Author

@alexzherdev Would you be willing to help review some of the other PRs? 🙏

sure 👌

@GMartigny
Copy link
Contributor

@alexzherdev You still need to add test for this. Maybe you can use what's already done to test rules to be in a "real life" scenario.

@sindresorhus
Copy link
Member

@alexzherdev Still interested in finishing this? :)

@alexzherdev
Copy link
Contributor Author

☝️updated

@sindresorhus sindresorhus merged commit e30eafa into avajs:master Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle destructured import of a test modifier
4 participants