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

Useful changes from my setup which I think may be beneficial to others #506

Closed
wants to merge 18 commits into from
Closed
7 changes: 7 additions & 0 deletions lib/__tests__/findUndefinedIdentifiers-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ it('knows about dynamic keys', () => {
`))).toEqual(new Set(['bar']));
});

it('knows about aliases in destructured objects', () => {
expect(findUndefinedIdentifiers(parse(`
const foo = { 'theValueOfMyConst': 123 };
const { [MY_CONST]: someAlias } = foo;
`))).toEqual(new Set(['MY_CONST']));
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice.


it('knows about jsx', () => {
expect(findUndefinedIdentifiers(parse(`
export default <FooBar foo={bar} />;
Expand Down
Loading