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

Consolidate side effect detection #6481

Closed
Boshen opened this issue Oct 12, 2024 · 4 comments
Closed

Consolidate side effect detection #6481

Boshen opened this issue Oct 12, 2024 · 4 comments
Assignees
Labels
C-enhancement Category - New feature or request

Comments

@Boshen Boshen added the C-enhancement Category - New feature or request label Oct 12, 2024
@Boshen Boshen self-assigned this Oct 12, 2024
@pumano
Copy link
Contributor

pumano commented Oct 12, 2024

@Boshen how do you think about oxlint rule that help developers found potentially problematic "side-effect" places in source code? Currently I try to migrate my large monorepo to isolatedModules / isolatedDeclarations and also mark libs as "sideEffects": false but has fear about potential side effects :)

TypeScript 5.6 add some useful --noUncheckedSideEffectImports but only for checking possibility to import it correctly. But would be good to have warns / errors when code not just imported but run (evaluated) after import in old school fashion.

@Boshen
Copy link
Member Author

Boshen commented Oct 14, 2024

@Boshen how do you think about oxlint rule that help developers found potentially problematic "side-effect" places in source code? Currently I try to migrate my large monorepo to isolatedModules / isolatedDeclarations and also mark libs as "sideEffects": false but has fear about potential side effects :)

TypeScript 5.6 add some useful --noUncheckedSideEffectImports but only for checking possibility to import it correctly. But would be good to have warns / errors when code not just imported but run (evaluated) after import in old school fashion.

It's doable but probably not at this stage. We also have tree_shaking/no-side-effects-in-initialization https://oxc.rs/docs/guide/usage/linter/rules/tree_shaking/no-side-effects-in-initialization.html for libraries.

@Boshen

This comment was marked as off-topic.

@Boshen Boshen closed this as completed Oct 14, 2024
@Boshen Boshen reopened this Oct 14, 2024
@Boshen
Copy link
Member Author

Boshen commented Oct 22, 2024

Going to focus on other things first.

@Boshen Boshen closed this as not planned Won't fix, can't repro, duplicate, stale Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category - New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants