From fd8670526250dd3efcbf67ccf3e8720a205dfb81 Mon Sep 17 00:00:00 2001 From: miracles1919 <516571350@qq.com> Date: Sat, 13 Aug 2022 20:33:31 +0800 Subject: [PATCH] chore: use prettierrc js file (#62) * chore: migrate prettier config * chore: update --- .prettierrc.js | 18 ++++++++++++++++++ package.json | 11 ----------- 2 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 .prettierrc.js diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..2bfff0b --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,18 @@ +module.exports = { + printWidth: 80, + singleQuote: true, + trailingComma: 'all', + proseWrap: 'never', + overrides: [ + { + files: '.prettierrc', + options: { + parser: 'json', + }, + }, + ], + plugins: [ + require.resolve('prettier-plugin-organize-imports'), + require.resolve('prettier-plugin-packagejson'), + ], +}; diff --git a/package.json b/package.json index 71c67a8..dc8a691 100644 --- a/package.json +++ b/package.json @@ -41,17 +41,6 @@ "prettier --parser=typescript --write" ] }, - "prettier": { - "pluginSearchDirs": false, - "plugins": [ - "prettier-plugin-organize-imports", - "prettier-plugin-packagejson" - ], - "printWidth": 80, - "proseWrap": "never", - "singleQuote": true, - "trailingComma": "all" - }, "dependencies": { "@microsoft/api-extractor": "7.25.1", "@umijs/babel-preset-umi": "^4.0.0",