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

feat(rome_js_analyze): useEnumInitializers #3839

Merged
merged 2 commits into from
Dec 5, 2022
Merged

feat(rome_js_analyze): useEnumInitializers #3839

merged 2 commits into from
Dec 5, 2022

Conversation

Conaclos
Copy link
Contributor

Summary

This implements ESLint's prefer-enum-initializers under the name useEnumInitializers.

In contrast to ESLint, this PR adds some improvement to the suggested fix.

ESLint suggests for any member two possible fixes: assigning 0 or assigning the name of the member.

This rule proposes a possible fix based on the last (among previous) initialized member, if any. If this member does not exist or if it is a number, then the proposed value corresponds to the implicit value of the member (given by TSC). Otherwise, if the member exists, is a string that is equal to the member name, then the proposed value is the name of the member.

Test Plan

Unit tests and doc-tests included.

@Conaclos Conaclos requested a review from a team November 23, 2022 22:42
@netlify
Copy link

netlify bot commented Nov 23, 2022

Deploy Preview for docs-rometools ready!

Name Link
🔨 Latest commit 138f0ae
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/638dc038cb76aa000950eed2
😎 Deploy Preview https://deploy-preview-3839--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.

@Conaclos Conaclos requested review from leops and removed request for xunilrj, ematipico and MichaReiser November 24, 2022 16:45
@ematipico
Copy link
Contributor

@Conaclos I think something went wrong with your latest commits. There's ton of changes now

@Conaclos Conaclos requested a review from a team as a code owner November 25, 2022 09:35
@Conaclos Conaclos requested review from ematipico and removed request for leops November 29, 2022 09:46
@ematipico
Copy link
Contributor

The rule looks good to me @Conaclos, a question for you: in which group would you see this lint rule be?

@ematipico ematipico added the A-Linter Area: linter label Nov 29, 2022
@ematipico ematipico added this to the 11.0.0 milestone Nov 29, 2022
@MichaReiser MichaReiser merged commit 2bfced0 into rome:main Dec 5, 2022
@Conaclos Conaclos deleted the use_enum_initializers branch March 7, 2023 16:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载