Closed IanVS closed 1 year ago
Fixes https://github.com/IanVS/prettier-plugin-sort-imports/issues/103
We were using a type which indicated that filepath would not be undefined, but perhaps that's the wrong type to be using. At any rate, I've adjusted our code to handle a missing filepath when prettier is used on text rather than a file.
The types we are using: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/748cf8849b6c67026557632fc1fe2ebbbef0700c/types/prettier/index.d.ts#L288
Fixes https://github.com/IanVS/prettier-plugin-sort-imports/issues/103
We were using a type which indicated that filepath would not be undefined, but perhaps that's the wrong type to be using. At any rate, I've adjusted our code to handle a missing filepath when prettier is used on text rather than a file.
The types we are using: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/748cf8849b6c67026557632fc1fe2ebbbef0700c/types/prettier/index.d.ts#L288