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

Implement prepend/append #1105

Open
Tracked by #656
HerringtonDarkholme opened this issue May 3, 2024 · 0 comments
Open
Tracked by #656

Implement prepend/append #1105

HerringtonDarkholme opened this issue May 3, 2024 · 0 comments

Comments

@HerringtonDarkholme
Copy link
Member

HerringtonDarkholme commented May 3, 2024

Add prepend/append statements in fix

⭐ Suggestion

It is usually desirable to prepend/append extra content to a file during a code fix.
For example, setting up a top-level variable, importing a function and etc.

💻 Use Cases

Suppose we want to extract some repetitive code.

const result = () => {
  doSomeRepetitiveCode()
}

to

import { importedUtil } from 'utils' // note this line
const result = importedUtil()

The first line should import the extracted util function from another file.


Change console.log to logger.log

console.log('message')

to

import logger from 'logger'
logger.log('message')
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

No branches or pull requests

1 participant