Closed bespokebob closed 5 years ago
Filepath never seems to be passed in as an option
I think it depends on the editor. By debugging VSCode, it provides the file path value properly.
Filepath never seems to be passed in as an option
I think it depends on the editor. By debugging VSCode, it provides the file path value properly.
This issue was over a year ago. It was definitely causing me trouble at the time, but there's no telling what has changed in VSCode and Prettier internals since then.
When running the plugin from an editor, the current working directory may not be the same as the project directory. Filepath never seems to be passed in as an option, so just fake it with the extension and resolve the directory name to the project directory this is running in. Note: this assumes that this plugin is installed in a node_modules folder of a project, not globally.