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

forbid via eslint to use the Buffer class in the code #1569

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Danil42Russia
Copy link
Contributor

In a comment #1565 (comment) @verytactical wrote:

Buffer is Node's non-standard API for binary data, while there is platform-agnostic Blob. When we build browser version of @tact-lang/compiler, we have to include a polyfill for Buffer.

While there are other places that use Buffer, we're working hard to remove them. I'd consider removing Buffer support here too.

So my suggestion is to disallow it via an eslint rule. This is a concept, if you like it I will add ignore existing errors.

Checklist

  • I have updated CHANGELOG.md
  • I have run all the tests locally and no test failure was reported
  • I have run the linter, formatter and spellchecker
  • I did not do unrelated and/or undiscussed refactorings

@Danil42Russia Danil42Russia requested a review from a team as a code owner January 25, 2025 15:53
Copy link
Member

@anton-trunov anton-trunov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So my suggestion is to disallow it via an eslint rule. This is a concept, if you like it I will add ignore existing errors.

I'm in favor of disallowing Buffer, but we should not just ignore all the existing errors, it needs to be case-by-case.

Also, this issue is relevant here: #1434.

@Danil42Russia
Copy link
Contributor Author

So my suggestion is to disallow it via an eslint rule. This is a concept, if you like it I will add ignore existing errors.

I'm in favor of disallowing Buffer, but we should not just ignore all the existing errors, it needs to be case-by-case.

Also, this issue is relevant here: #1434.

Yes, you're right, but this will prohibit adding new code using Buffer.
I'm going to create an issue to replace it, and I'll specify it in the 'eslint' error. Well, I must say what to use instead of it.

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.

2 participants