Closed richex-cn closed 1 year ago
It seems like I overlooked the typescript plugin:
/** @type {import('prettier').Options} */
module.exports = {
plugins: [
require.resolve('@prettier/plugin-pug'),
require.resolve('@trivago/prettier-plugin-sort-imports'),
],
importOrder: ['^@/config(.*)$', '^@/util(.*)$', '^@/common(.*)$', '^@/(.*)$', '^[./]'],
importOrderSeparation: true,
importOrderParserPlugins: ['typescript', '["decorators", { "decoratorsBeforeExport": true }]'],
}
It's working normally now.
Your Environment
Describe the bug
Error formatting using VSCode when using vue-property-decorator in Vue file.
To Reproduce
test.vue
.Format Document With
Prettier - Code formatter
Expected behavior
Format normal.
Screenshots, code sample, etc
Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)
Error log
Contribute to @trivago/prettier-plugin-sort-imports