-
Notifications
You must be signed in to change notification settings - Fork 18
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: js object shorthand #194
base: main
Are you sure you want to change the base?
Conversation
title: Disallow shorthand type conversions | ||
tags: [good-practice] | ||
--- | ||
This matches the [eslint rule](https://eslint.org/docs/latest/rules/no-implicit-coercion). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a lot more logic from the eslint rule that would be needed to make this correct. It's probably not useful tbh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@morgante I found it very useful for readability. I ran it on an internal project +200 matches, it went smoothly. can you give an example ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you look in the eslint source it does more checks to ensure things like booleans aren't doubly cast. If you want to take the time to mirror that logic, I don't object - but most people will probably still just use eslint or biome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@morgante I actually just noticed I took the branch from the other feature (no implicit coercion). I'll split the PR. I'll also check the ESlint source, but probably gonna look for another rule
0501826
to
ca29cd9
Compare
4f27da6
to
981bfce
Compare
https://app.grit.io/studio?key=fsNvFDGI4px3u5p7VdAQZ