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

🐛 noUnusedVariables doesn't seem to take decorators into account #3741

Closed
1 task done
Marcisbee opened this issue Nov 15, 2022 · 1 comment
Closed
1 task done
Labels
S-To triage Status: user report of a possible bug that needs to be triaged

Comments

@Marcisbee
Copy link
Contributor

Environment information

CLI:
  Version:              10.0.0
  Color support:        true

Platform:
  CPU Architecture:     aarch64
  OS:                   macos

Environment:
  ROME_LOG_DIR:         unset
  NO_COLOR:             unset
  TERM:                 "xterm-256color"

Rome Configuration:
  Status:               loaded
  Formatter disabled:   false
  Linter disabled:      false

Workspace:
  Open Documents:       0

What happened?

So rome returns error for this code:

import { Exome } from 'exome';

import { undoable } from './undo';

export class CommentStore extends Exome {
  constructor(public comment: string) {
    super();
  }

  @undoable()
  public setComment(comment: string) {
    this.comment = comment;
  }
}
  ⚠ This variable is unused.

    1 │ import { Exome } from 'exome';
    2 │
  > 3 │ import { undoable } from './undo';
      │          ^^^^^^^^
    4 │
    5 │ export class CommentStore extends Exome {

Even tho undoable is clearly used as a decorator.

Expected result

It should not mark undoable as unused variable.

Code of Conduct

  • I agree to follow Rome's Code of Conduct
@Marcisbee Marcisbee added the S-To triage Status: user report of a possible bug that needs to be triaged label Nov 15, 2022
@ematipico
Copy link
Contributor

Duplicate of #3197

@ematipico ematipico marked this as a duplicate of #3197 Nov 15, 2022
@ematipico ematipico closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
S-To triage Status: user report of a possible bug that needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants