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

Replace var with let and const for Modern JavaScript Standards #2000

Open
manotoor opened this issue Jan 8, 2025 · 2 comments
Open

Replace var with let and const for Modern JavaScript Standards #2000

manotoor opened this issue Jan 8, 2025 · 2 comments
Labels
enhancement New feature or request Needs Testing

Comments

@manotoor
Copy link

manotoor commented Jan 8, 2025

Describe the bug
Looks like we are using older JS variables, we should move towards modern tech stack. Since let const supersede var and help with proper scoping

To Reproduce
Seems we have a few references to "var" for typescript files
https://github.com/search?q=repo%3AelizaOS%2Feliza+%2Fvar+.*%2F+path%3A**%2F*.ts&type=code

Expected behavior

update references to const, (seems like they are coming from hooks)
Expected

let baseURL = models[provider].endpoint;

Actual

var baseURL = models[provider].endpoint;

Expected

const [tx, err] = await indexer.upload(
                file,
                0,
                zgEvmRpc,
                flowContract
            );

Actual

var [tx, err] = await indexer.upload(
                file,
                0,
                zgEvmRpc,
                flowContract
            );

^ this one might need to be looked into more. Seems like tx is only logged not sure if it's referenced outside of scope.

Screenshots

image
image

Additional context

@manotoor manotoor added the bug Something isn't working label Jan 8, 2025
Copy link
Contributor

github-actions bot commented Jan 8, 2025

Hello @manotoor! Welcome to the ai16z community. Thank you for opening your first issue; we appreciate your contribution. You are now a ai16z contributor!

@AIFlowML AIFlowML added enhancement New feature or request Needs Testing and removed bug Something isn't working labels Jan 9, 2025
@yashmangal112
Copy link

Hi @manotoor, can I solve this issue? I want to contribute to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Needs Testing
Projects
None yet
Development

No branches or pull requests

3 participants