iljapostnovs / ui5plugin-linter

Linter for UI5 projects
Apache License 2.0
12 stars 3 forks source link

Bug: JS WrongFilePathLinter triggering in string templates #136

Closed netux closed 1 year ago

netux commented 1 year ago

Describe the bug The JS WrongFilePathLinter may trip up when trying to find the file of a class path generated dynamically using string literals.

In my case, I have the following function:

loadFragmentRelative(fragmentName) {
  return this.loadFragment({ name: `com.mycompany.myapp.view.${fragmentName}` });
}

To Reproduce Steps to reproduce the behavior:

  1. Type the following in a Controller:
    `com.mycompany.myapp.${someValue}`
  2. Run the linter
  3. WrongFilePathLinter error is triggered saying it cannot find a file under "com.mycompany.myapp.${someValue"

Expected behavior I'd rather WrongFilePathLinter skip this error.

Screenshots N/A

Desktop (please complete the following information):

Additional context This may also happen with normal string concatenation. E.g.:

"com.mycompany.myapp." + someValue

Project attachment N/A. I don't think it is needed.

iljapostnovs commented 1 year ago

Fixed, please check

netux commented 1 year ago

Solved. Thank you!