-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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(typescript-estree): align optional fields #1429
feat(typescript-estree): align optional fields #1429
Conversation
This comment has been minimized.
This comment has been minimized.
why is this breaking? It looks like a backwards-compatible addition. |
AST produced by our converter is going to differ for existing code base, this is not an issue for our plugin, but its a breaking change for eg. prettier |
As long as a consumer's runtime code doesn't break as part of the addition, it's non-breaking.
So the overall shape of the AST is consistent, and existing code will not break. |
Codecov Report
@@ Coverage Diff @@
## v3 #1429 +/- ##
==========================================
- Coverage 93.78% 93.78% -0.01%
==========================================
Files 172 172
Lines 7809 7808 -1
Branches 2243 2242 -1
==========================================
- Hits 7324 7323 -1
Misses 227 227
Partials 258 258
|
Now, in a |
Ah, sorry - I missed the missing Question: |
Don't worry about Prettier. It's already smart enough to find |
@bradzacher i will prefer to not replicate / duplicate informations across nodes, thats why its a breaking change. |
# Conflicts: # packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap
This is BREAKING CHANGE
Goal of this change is to align how we are marking optional properties and methods,
Difference between this PR and #1100 is that instead of trying to add "optional" to key of method/property we are directly marking method with it.
This is more aligned with how typescript produces ast and how babel generates estree for this field.
read more: #1100 (comment)
context prettier/prettier#6601, prettier/prettier#6678
closes #1100
fixes #1097
cc @sosukesuzuki @thorn0 @fisker