-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(prettier): add back packagejson plugin
- Loading branch information
Showing
4 changed files
with
28 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Options } from 'prettier'; | ||
|
||
declare const config: Options; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
module.exports = { | ||
// Prettier 兼容 EditorConfig,凡是能够在 EditorConfig 中配置的,这里就不再定义,避免冲突 | ||
// 详见 https://prettier.io/docs/en/options | ||
printWidth: 100, | ||
tabWidth: 2, | ||
tabs: false, | ||
semi: true, | ||
singleQuote: true, | ||
quoteProps: 'as-needed', | ||
jsxSingleQuote: false, | ||
trailingComma: 'all', | ||
bracketSpacing: true, | ||
bracketSameLine: false, | ||
arrowParens: 'always', | ||
bracketSpacing: true, // https://prettier.io/docs/en/options#bracket-spacing | ||
semi: true, // https://prettier.io/docs/en/options#semicolons | ||
trailingComma: 'all', // https://prettier.io/docs/en/options#trailing-commas | ||
|
||
// Prettier 2.x 可以自动加载 prettier-plugin- 开头的插件 | ||
// 但是从 Prettier 3.x 开始,插件必须配置才能生效 | ||
endOfLine: 'lf', | ||
// 从 Prettier 3.x 开始,插件必须配置才能生效 | ||
plugins: [ | ||
// 'prettier-plugin-packagejson', // 排序 package.json 中的属性,ESM 项目报错,暂时禁用 | ||
// 排序 package.json 中的属性,ESM 项目报错,暂时禁用 | ||
'prettier-plugin-packagejson', | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters