This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 657
fix(rome_js_analyze): should handle read-only arrays #3954
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
✅ Deploy Preview for docs-rometools ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
unvalley
requested review from
leops,
ematipico,
xunilrj,
MichaReiser and
a team
as code owners
December 10, 2022 06:40
MichaReiser
suggested changes
Dec 10, 2022
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.
readonly
is a type operation and is represented by the TsTypeOperatorType
node. You can inspect the AST of an array with a readonly operation by opening this playground.
It's, therefore, not necessary to change the AST to support readonly arrays. Instead, the lint must create a new TsTypeOperatorType
where the operation_token
is readonly
and ty
is the array type
test: add test case fix diagnostic and action for readonly refactor: filter_map logic test: update snapshot fix: around array type for ungram change test: remove compile failed test case test: update snapshot test: update failed parser test chore: fmt doc: update website doc fix: use TsTypeOperatorType for readonly_token chore: restore ungram chore: restore parser test_data chore: restore and fmt chore: restore fix: array_type build
@MichaReiser Thanks, I've fixed to use |
unvalley
requested review from
MichaReiser
and removed request for
xunilrj,
ematipico and
leops
December 13, 2022 17:54
leops
approved these changes
Dec 15, 2022
crates/rome_js_analyze/src/analyzers/style/use_shorthand_array_type.rs
Outdated
Show resolved
Hide resolved
MichaReiser
approved these changes
Dec 15, 2022
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Closes #3864
add readonly modifier to TsArrayType by editing js.ungramThis causes lots of file changes.Test Plan