Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_js_analyze): should handle read-only arrays #3954

Merged
merged 7 commits into from
Dec 16, 2022
Merged

fix(rome_js_analyze): should handle read-only arrays #3954

merged 7 commits into from
Dec 16, 2022

Conversation

unvalley
Copy link
Contributor

@unvalley unvalley commented Dec 5, 2022

Summary

Closes #3864

  • add readonly modifier to TsArrayType by editing js.ungram
    • This causes lots of file changes.

Test Plan

cargo test // on rome_js_analyze

@netlify
Copy link

netlify bot commented Dec 5, 2022

Deploy Preview for docs-rometools ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 9582248
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/639bca1e4a9397000937344d
😎 Deploy Preview https://deploy-preview-3954--docs-rometools.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@unvalley unvalley marked this pull request as ready for review December 10, 2022 06:39
Copy link
Contributor

@MichaReiser MichaReiser left a 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

@unvalley unvalley marked this pull request as draft December 13, 2022 16:11
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
@unvalley unvalley marked this pull request as ready for review December 13, 2022 17:28
@unvalley
Copy link
Contributor Author

@MichaReiser Thanks, I've fixed to use TsTypeOperatorType. Please take a look.

@unvalley unvalley requested review from MichaReiser and removed request for xunilrj, ematipico and leops December 13, 2022 17:54
@leops leops merged commit fab5440 into rome:main Dec 16, 2022
@unvalley unvalley deleted the fix-use-short-hand-array-type branch December 18, 2022 09:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📎 useShorthandArrayType should handle read-only arrays
3 participants