-
Notifications
You must be signed in to change notification settings - Fork 4
NEW @W-20597715@ Adding changes to support react in .jsx files for single react plugin [Inital PR to review the LLD] #392
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
base: dev
Are you sure you want to change the base?
Conversation
| // Note: disable_react_base_config is intentionally excluded - React support is gated | ||
| // TODO: Add 'disable_react_base_config' when React support is released |
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.
How can you actually test this then?
Shouldn't you then use the
addKeysThatBypassValidation
method then so that this key (when attempting to use it internally) doesn't throw an error by this check? See https://github.com/forcedotcom/code-analyzer-core/blob/dev/packages/code-analyzer-core/src/config.ts#L145C25-L145C52 for 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.
Thanks for pointing this out I was adding the code to read it from config extractor when testing it. This simplifies the changes needed for testing.
| // Deep clone the languageOptions to avoid mutating the original shared config from the LWC package | ||
| const originalParserOptions = configs[0].languageOptions!.parserOptions as Linter.ParserOptions; | ||
| const clonedBabelOptions = JSON.parse(JSON.stringify(originalParserOptions.babelOptions)); | ||
| configs[0].languageOptions = { | ||
| ...configs[0].languageOptions, | ||
| parserOptions: { | ||
| ...originalParserOptions, | ||
| babelOptions: clonedBabelOptions | ||
| } | ||
| }; |
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.
You shouldn't be needing to do any cloning. Simply reconstruct and override using the {...someObj, someField: { ...someObj.someField, someSubField: xyz }} trick!
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.
Ack, using spread operator makes the code more concise have added it instead of deep cloning.
No description provided.