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

🐛 Imports in *.module.ts are always unused (noUnusedVariables) #4313

Closed
1 task done
DevMark97 opened this issue Mar 21, 2023 · 7 comments
Closed
1 task done

🐛 Imports in *.module.ts are always unused (noUnusedVariables) #4313

DevMark97 opened this issue Mar 21, 2023 · 7 comments
Labels
S-To triage Status: user report of a possible bug that needs to be triaged

Comments

@DevMark97
Copy link

Environment information

CLI:
  Version:              11.0.0
  Color support:        true

Platform:
  CPU Architecture:     x86_64
  OS:                   windows

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

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

What happened?

Open any *.module.ts file in angular project. You can see that every import has error "This variable is unused." but is located in imports below.
Przechwytywanie

Expected result

Rome should not mark these imports as error

Code of Conduct

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

Thank you for your issue.
Rome doesn't support decorators now.
#4252

@DevMark97
Copy link
Author

So imports in lines 22-33 rome recognises as decorators?

@denbezrukov
Copy link
Contributor

denbezrukov commented Mar 21, 2023

@DevMark97

Yes, Rome can't parse expressions inside the decorator. See the syntax tab in playground

@ematipico
Copy link
Contributor

ematipico commented Mar 21, 2023

So imports in lines 22-33 rome recognises as decorators?

Yes, everything inside the decorator is ignored by the parser, that's why the rule can't find the usage of your imports.

@jpike88
Copy link

jpike88 commented Mar 27, 2023

I'm using angular, I have this rule disabled for the time being.

Although this should be something detected by typescript itself (warning not an error), but should cause your attempt to build angular to error anyway.

@denbezrukov
Copy link
Contributor

I've taken decorators in progress, it should be fixed soon:)

@jpike88
Copy link

jpike88 commented Apr 20, 2023

looks like this can be closed

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

5 participants