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 imports and exports anywhere #123

Merged
merged 4 commits into from Jan 16, 2023
Merged

Support imports and exports anywhere #123

merged 4 commits into from Jan 16, 2023

Conversation

lydell
Copy link
Owner

@lydell lydell commented Jan 15, 2023

Fixes #121

In JavaScript, imports and exports can only appear at the top level – in the Program node.

In Svelte via eslint-plugin-svelte, the imports and exports are inside the SvelteScriptElement node though.

In TypeScript, you can also have imports and exports inside declare module.

This PR supports imports and exports anywhere, by finding the set of parents of all imports and exports and working with those.

@lydell lydell changed the title Support non-toplevel imports and exports Support imports and exports anywhere Jan 16, 2023
@lydell lydell marked this pull request as ready for review January 16, 2023 21:42
@lydell lydell merged commit f57b913 into main Jan 16, 2023
@lydell lydell deleted the imports-anywhere branch January 16, 2023 21:45
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.

Add support for svelte-eslint-parser and TS module declarations
1 participant