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

[feature] support import package automaticly #774

Closed
imcuttle opened this issue Dec 12, 2023 · 4 comments
Closed

[feature] support import package automaticly #774

imcuttle opened this issue Dec 12, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@imcuttle
Copy link

⭐ Suggestion

I want to fix the code which using global variable instead of package.

💻 Use Cases

Before

const val = __global_value;

Fixed

import { globalValue } from 'some-package';

const val = globalValue;
@imcuttle imcuttle added the enhancement New feature or request label Dec 12, 2023
@HerringtonDarkholme
Copy link
Member

Sorry, I don't know your question. Are you asking how to write rule?
If so, https://ast-grep.github.io/guide/quick-start.html please read the documentation.

@imcuttle
Copy link
Author

@HerringtonDarkholme I want to know how to rewrite code by importing code.
The current rule replaces pattern simply.

@HerringtonDarkholme
Copy link
Member

It's not possible at the moment. But it is tracked by #656

@HerringtonDarkholme
Copy link
Member

Tracked by #656. I think we should discuss there for ideations.

@HerringtonDarkholme HerringtonDarkholme closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants