Closed KuznetsovRoman closed 1 year ago
What output do you see for ESLint-Prettier in the terminal?
What output do you see for ESLint-Prettier in the terminal?
Error: Failed to load plugin 'react-hooks' declared in 'CLIOptions': The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received ''
TypeError: Failed to load plugin 'react-hooks' declared in 'CLIOptions': The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received ''
at new NodeError (node:internal/errors:371:5)
at createRequire (node:internal/modules/cjs/loader:1281:13)
at Object.resolve (/Users/kroman512/my-project/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2325:16)
at ModuleResolver.resolve (/Users/kroman512/my-project/node_modules/@rushstack/eslint-patch/lib/modern-module-resolution.js:201:44)
at ConfigArrayFactory._loadPlugin (/Users/kroman512/my-project/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3376:33)
at ConfigArrayFactory._loadPlugin (/Users/kroman512/my-project/node_modules/@rushstack/eslint-patch/lib/modern-module-resolution.js:203:43)
at /Users/kroman512/my-project/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3267:33
at Array.reduce (<anonymous>)
at ConfigArrayFactory._loadPlugins (/Users/kroman512/my-project/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3263:22)
at ConfigArrayFactory._normalizeObjectConfigDataBody (/Users/kroman512/my-project/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3063:44)
at _normalizeObjectConfigDataBody.next (<anonymous>)
at ConfigArrayFactory._normalizeObjectConfigData (/Users/kroman512/my-project/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3003:20)
at _normalizeObjectConfigData.next (<anonymous>)
at ConfigArrayFactory.create (/Users/kroman512/my-project/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:2798:16)
at createCLIConfigArray (/Users/kroman512/my-project/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3608:47)
at CascadingConfigArrayFactory.clearCache (/Users/kroman512/my-project/node_modules/@eslint/eslintrc/dist/eslintrc.cjs:3780:32)
at new ESLint (/Users/kroman512/my-project/node_modules/eslint/lib/eslint/eslint.js:448:32)
at $me (/Users/kroman512/.vscode/extensions/rvest.vs-code-prettier-eslint-5.1.0/dist/extension.js:185:69)
at /Users/kroman512/.vscode/extensions/rvest.vs-code-prettier-eslint-5.1.0/dist/extension.js:193:700
at zme (/Users/kroman512/.vscode/extensions/rvest.vs-code-prettier-eslint-5.1.0/dist/extension.js:185:1432)
https://github.com/idahogurl/vs-code-prettier-eslint/issues/42 seems related
Looks like the problem is in @rushstack/eslint-patch
package
https://github.com/idahogurl/vs-code-prettier-eslint/issues/72#issuecomment-1247516987 solved the problem
Describe the bug
I installed the extension and copy-pasted
.vscode/settings.json
from example to my next typescript project, but when i save the file or launchFormat Document
(With Prettier ESLint
is choosed) nothing happens. I added a stroke:and tried to run the extension on the file, expecting it would unwrap the object, like manual
npx prettier --write .
does, but nothing changes. Output log only saysIncorrect type. Expected "boolean". [Ln 8, Col 45]
, but usingtrue
/false
instead of"true"
/"false"
does not help. Another prettier extension works, but after deleting it,Prettier Eslint
doesn't work anyway.To Reproduce
eslint
,prettier
,@typescript-eslint/parser
with versions above.vscode/settings.json
from the example: https://pastebin.com/2j5AWn3UFormat Document
commandExpected behavior The statement turns into:
like after launching
npx prettier --write .
manuallyExample Project
package versions:
.vscode/settings.json
: https://pastebin.com/CjH8qjFC.eslintrc.json
: https://pastebin.com/tgrK3yPp.prettierrc.json
: https://pastebin.com/wwdzzc1Xtsconfig.json
: https://pastebin.com/X64McuVuVersions:
System Specifications (please complete the following information):