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

🐛 Recommended rules for a group are disabled if you disable a single rule #4502

Closed
1 task done
Vivalldi opened this issue May 17, 2023 · 1 comment · Fixed by #4503
Closed
1 task done

🐛 Recommended rules for a group are disabled if you disable a single rule #4502

Vivalldi opened this issue May 17, 2023 · 1 comment · Fixed by #4503
Assignees
Labels
A-CLI Area: CLI S-Bug: confirmed Status: report has been confirmed as a valid bug

Comments

@Vivalldi
Copy link
Contributor

Environment information

CLI:
  Version:                      12.1.1
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  ROME_LOG_DIR:                 unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v18.14.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/3.3.1"

Rome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    true
  VCS disabled:                 true

Workspace:
  Open Documents:               0

Discovering running Rome servers...

Incompatible Rome Server: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

i Rage discovered this running server using an incompatible version of Rome.

Server:
  Version:                      12.0.0

Incompatible Rome Server: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

i Rage discovered this running server using an incompatible version of Rome.

Server:
  Version:                      12.1.0

Running Rome Server: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

i The client isn't connected to any server but rage discovered this running Rome server.

Server:
  Version:                      12.1.1
  Name:                         rome_lsp
  CPU Architecture:             aarch64
  OS:                           macos

Workspace:
  Open Documents:               0

Other Active Server Workspaces:

Workspace:
  Open Documents:               2
  Client Name:                  Visual Studio Code
  Client Version:               1.78.2

Rome Server Log:

! Please review the content of the log file before sharing it publicly as it may contain sensitive information:
  * Path names that may reveal your name, a project name, or the name of your employer.
  * Source code

What happened?

  1. Updated from v12.1.0 to v12.1.1
  2. Ran a rome check to see if anything started failing
  3. Noticed "Suppression comment is not being used" showing up for lint/a11y/useKeyWithClickEvents
  4. Adding recommended: true to a11y section causes it to go away

Expected result

I don't expect recommended rules to be disabled during a patch update. After digging into it some, it happens because the global "recommended" setting is not followed if a group defines any rules.

#4490 (comment)

Code of Conduct

  • I agree to follow Rome's Code of Conduct
@Vivalldi Vivalldi added the S-To triage Status: user report of a possible bug that needs to be triaged label May 17, 2023
@Vivalldi
Copy link
Contributor Author

Vivalldi commented May 17, 2023

Config

{
  "$schema": "https://docs.rome.tools/schemas/12.1.0/schema.json",
  "organizeImports": {
    "enabled": false
  },
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true,
      "complexity": {
        "noUselessSwitchCase": "off"
      }
    }
  }
}

test file that's no longer erroring on lint/complexity/useFlatMap

const array = ["split", "the text", "into words"];
// next line should error because of the recommended rule
array.map((sentence) => sentence.split(" ")).flat();

Minimal repo branch - https://github.com/Vivalldi/rome-4479/tree/issue/4502

@ematipico ematipico self-assigned this May 17, 2023
@ematipico ematipico added S-Bug: confirmed Status: report has been confirmed as a valid bug A-CLI Area: CLI and removed S-To triage Status: user report of a possible bug that needs to be triaged labels May 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-CLI Area: CLI S-Bug: confirmed Status: report has been confirmed as a valid bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants