Skip to content

Support imports and exports anywhere#123

Merged
lydell merged 4 commits intomainfrom
imports-anywhere
Jan 16, 2023
Merged

Support imports and exports anywhere#123
lydell merged 4 commits intomainfrom
imports-anywhere

Conversation

@lydell
Copy link
Copy Markdown
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