Prettier-vscode: prettier.configPath don't work

Created on 13 Nov 2019  路  6Comments  路  Source: prettier/prettier-vscode

Summary

prettier.configPath don't work

Steps To Reproduce:

  1. I create a .prettierrc.js file in ~/.prettierrc.js
  2. setting prettier.configPath "prettier.configPath": "~/.prettierrc.js"
  3. the config don't work.
  4. I remove the .prettierrc.js file to my project's root path;and delete the setting "prettier.configPath": "~/.prettierrc.js"
  5. the confit work.

VS Code Version:
鐗堟湰: 1.40.0
鎻愪氦: 86405ea23e3937316009fc27c9361deee66ffbf5
鏃ユ湡: 2019-11-06T17:09:34.601Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 19.0.0
Prettier & Prettier Plugin Version:
Prettier - Code formatter: 3.3.5
OS and version:
mac os
10.15.1

bug locked

Most helpful comment

This seems to be still not working, at least when using in connection with remote extension (remote is linux).
getting the error:

["ERROR" - 6:32:10 PM] Error resolving prettier configuration for /path/to/project/esources/js/app.js
ENOENT: no such file or directory, open '/path/to/project/~/.prettierrc'
Error: ENOENT: no such file or directory, open '/path/to/project/~/.prettierrc'

when setting

"prettier.configPath": "~/.prettierrc",

All 6 comments

the out message is this when I format .js file

[INFO - 10:36:31 AM] Formatting /Users/hezf/git/im-server/config/config.default.js.
[WARN - 10:36:31 AM] Falling back to bundled version of prettier.
[INFO - 10:36:31 AM] Resolved ignore file to /Users/hezf/git/im-server/.prettierignore.
[INFO - 10:36:31 AM] File Info:
{
  "ignored": false,
  "inferredParser": "babel"
}
[ERROR - 10:36:31 AM] Failed to resolve config for /Users/hezf/git/im-server/config/config.default.js. Falling back to the default config settings.
[INFO - 10:36:31 AM] Prettier Options:
{
  "filepath": "/Users/hezf/git/im-server/config/config.default.js",
  "parser": "babel"
}
[INFO - 10:36:31 AM] Formatting completed in 17.919448ms.

For anyone else having issues, you can click the gear icon in the extension bar to install an older version .
Screenshot from 2019-11-13 11-57-37

Should be fixed in 3.5.0. Plrease reopen if you are still having issues.

Thank you.
I use the VS COde config.

This seems to be still not working, at least when using in connection with remote extension (remote is linux).
getting the error:

["ERROR" - 6:32:10 PM] Error resolving prettier configuration for /path/to/project/esources/js/app.js
ENOENT: no such file or directory, open '/path/to/project/~/.prettierrc'
Error: ENOENT: no such file or directory, open '/path/to/project/~/.prettierrc'

when setting

"prettier.configPath": "~/.prettierrc",

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings