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

feat(linter): bad bitwise operator rule #246

Merged

Conversation

mysteryven
Copy link
Member

@mysteryven mysteryven commented Apr 2, 2023

feat: #243

I had thought that if I wanted to implement the rule, I would have to implement all the detail of this rule, but I didn't find the source code of this rule, so I only implement the cases I can think of.

I didn't implement the part that requires type inference, it will all pass:

let a = '1'
a |= {} // should error, but current pass

Maybe it is not the right implementation, any advice is welcome!

@Boshen
Copy link
Member

Boshen commented Apr 2, 2023

So far so good, request a review when you are done.

@mysteryven mysteryven marked this pull request as ready for review April 2, 2023 14:58
@mysteryven mysteryven marked this pull request as draft April 2, 2023 15:01
@mysteryven
Copy link
Member Author

It's beyond my ability to implement type inference, I am not plan to do it in this PR, except it, It's ready for review.

@mysteryven mysteryven marked this pull request as ready for review April 2, 2023 15:22
@Boshen Boshen merged commit b17335d into oxc-project:main Apr 2, 2023
@Boshen
Copy link
Member

Boshen commented Apr 2, 2023

Amazing work! Thank you so much for working on a rule that doesn't have existing tests!

@Boshen
Copy link
Member

Boshen commented Apr 2, 2023

I ran this in the VSCode repo, it seems people love to work on bitflag enums 🤔 I may have to demote this to another category later on. But it's fine for now.

@Boshen
Copy link
Member

Boshen commented Apr 2, 2023

Another option is to only use this in js files.

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