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

feat(rome_js_analyze): useLiteralEnumMembers #4409

Merged
merged 1 commit into from
Apr 26, 2023
Merged

feat(rome_js_analyze): useLiteralEnumMembers #4409

merged 1 commit into from
Apr 26, 2023

Conversation

Conaclos
Copy link
Contributor

@Conaclos Conaclos commented Apr 25, 2023

Summary

This implements prefer-literal-enum-member with a minor change: we accept all constant bitwise expressions while ESlint accepts only unary bitwise expressions with a single number and binary bitwise expressions with two number. ESLint reauires also to enable an option to allow bitwise expressions.

For instance, this rule accepts the following enum, while ESLint rejects it:

enum FileAccess {
    None = 0,
    Read = 1,
    Write = 1 << 1,
    All = 1 | (1 << 1) // ESlint rejects this
}

Test Plan

ESLint tests included.

Changelog

Changelog entry added

  • The PR requires a changelog line

Documentation

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

@netlify
Copy link

netlify bot commented Apr 25, 2023

Deploy Preview for docs-rometools failed.

Built without sensitive environment variables

Name Link
🔨 Latest commit aaf9c49
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/64491d1f857e8300084ce280

@github-actions github-actions bot added A-Diagnostic Area: errors and diagnostics A-Linter Area: linter A-Parser Area: parser A-Project Area: project configuration and loading labels Apr 25, 2023
@Conaclos Conaclos merged commit 19b60d4 into rome:main Apr 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Diagnostic Area: errors and diagnostics A-Linter Area: linter A-Parser Area: parser A-Project Area: project configuration and loading
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants