前端代码格式化 - 【Prettier】 - 常见配置 + 踩坑日记
最编程
2024-01-11 14:42:05
...
["INFO" - 17:48:07] Formatting 要格式化的文件路径
["ERROR" - 17:48:07] Error resolving prettier configuration for 要格式化的文件路径
["ERROR" - 17:48:07] Invalid or unexpected token
项目中prettier的配置文件路径:1
(function (exports, require, module, __filename, __dirname) { ��m
SyntaxError: Invalid or unexpected token
at new Script (node:vm:100:7)
at Module.u._compile (f:\VsCode\Microsoft VS Code\resources\app\out\vs\loader.js:4:1173)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1220:10)
at Module.load (node:internal/modules/cjs/loader:1035:32)
at Module._load (node:internal/modules/cjs/loader:876:12)
at Function.c._load (node:electron/js2c/asar_bundle:5:13343)
at Function.c._load (f:\VsCode\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:122:14101)
at Function.m._load (f:\VsCode\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:117:62404)
at Function.D._load (f:\VsCode\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:117:61797)
at Module.require (node:internal/modules/cjs/loader:1059:19)
at module2.exports (d:\Table top\zhongRuan\yunbg-platform\node_modules\prettier\third-party.js:83:61)
at loadJs2 (d:\Table top\zhongRuan\yunbg-platform\node_modules\prettier\third-party.js:8050:22)
at Explorer.loadFileContent (d:\Table top\zhongRuan\yunbg-platform\node_modules\prettier\third-party.js:8449:36)
at Explorer.createCosmiconfigResult (d:\Table top\zhongRuan\yunbg-platform\node_modules\prettier\third-party.js:8453:40)
at Explorer.loadSearchPlace (d:\Table top\zhongRuan\yunbg-platform\node_modules\prettier\third-party.js:8438:35)
at Explorer.searchDirectory (d:\Table top\zhongRuan\yunbg-platform\node_modules\prettier\third-party.js:8428:31)
at run (d:\Table top\zhongRuan\yunbg-platform\node_modules\prettier\third-party.js:8413:26)
at Explorer.search (d:\Table top\zhongRuan\yunbg-platform\node_modules\prettier\third-party.js:8407:24)
at Object.resolveConfigFile (d:\Table top\zhongRuan\yunbg-platform\node_modules\prettier\index.js:18499:22)
at t.ModuleResolver.resolveConfig (c:\Users\CaiQian\.vscode\extensions\esbenp.prettier-vscode-10.1.0\dist\extension.js:1:6697)
at t.ModuleResolver.getResolvedConfig (c:\Users\CaiQian\.vscode\extensions\esbenp.prettier-vscode-10.1.0\dist\extension.js:1:7529)
at t.default.format (c:\Users\CaiQian\.vscode\extensions\esbenp.prettier-vscode-10.1.0\dist\extension.js:1:14563)
at t.PrettierEditProvider.provideEdits (c:\Users\CaiQian\.vscode\extensions\esbenp.prettier-vscode-10.1.0\dist\extension.js:1:12672)
at q.provideDocumentFormattingEdits (f:\VsCode\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:98:39883)