runem / lit-analyzer

Monorepository for tools that analyze lit-html templates
MIT License
319 stars 38 forks source link

fix quickfix for 'no-missing-import' on windows. #110

Closed FelixSchuSi closed 4 years ago

FelixSchuSi commented 4 years ago

On windows, the quickfixes suggested by the "no-missing-import" rule generate broken paths when dealing with nested folders.

In a project with a structure like this:

parent.ts
children
  └─1
    └─folder
      └─another-folder
          child1.ts

When you generate an import for child1.ts inside of parent.ts your get this statement:

import "./children\1\folder\another-folder/child1";

This doesnt work since imports require UNIX-like file paths with forward slashes.

This PR fixes the bug. The generated import statement now looks like this:

import "./children/1/folder/another-folder/child1";

runem commented 4 years ago

Thank you very much for this fix, it looks great!