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

feat(rome_js_analyze): noUnsafeOptionalChain, no-unsafe-optional-chaining #3985 #4081

Merged
merged 1 commit into from
Feb 16, 2023

Conversation

denbezrukov
Copy link
Contributor

Summary

Close #3985

Original eslint rule has an option disallowArithmeticOperators decided to skip it for now.

Eslint rule and current version have a different implementation:

  1. eslint traverses from the nodes which can throw an error if they have an option chain inside.
  2. current version starts from the optional chain and tries to find a parent which can throw an error.

It seems that the second version is more efficient because it skips nodes without option chaining.

Test Plan

Added test cases from eslint
cargo test

Documentation

  • The PR requires documentation
  • I will create a new PR to update the documentation

@netlify
Copy link

netlify bot commented Dec 21, 2022

Deploy Preview for docs-rometools ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit c75e616
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/63ee58978034580008046565
😎 Deploy Preview https://deploy-preview-4081--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.

@denbezrukov denbezrukov force-pushed the feature/no-unsafe-optional-chain-1 branch from eef31ac to e4689d6 Compare December 29, 2022 14:17
@denbezrukov denbezrukov force-pushed the feature/no-unsafe-optional-chain-1 branch 3 times, most recently from eb89f2c to 9ab1cd6 Compare January 7, 2023 11:02
@denbezrukov denbezrukov requested review from ematipico and removed request for xunilrj and leops January 7, 2023 11:18
@Conaclos Conaclos added the A-Linter Area: linter label Feb 15, 2023
@denbezrukov denbezrukov force-pushed the feature/no-unsafe-optional-chain-1 branch from 9ab1cd6 to c75e616 Compare February 16, 2023 16:23
@ematipico ematipico merged commit c2c1fe7 into rome:main Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

noUnsafeOptionalChain, no-unsafe-optional-chaining
3 participants