From 47c8ac2b5d88ecb6789e94f9b2ad3ef64faa8023 Mon Sep 17 00:00:00 2001 From: Burt <1020103647@qq.com> Date: Thu, 21 Dec 2023 15:33:50 +0800 Subject: [PATCH] build(prettier): add .prettierrc.js --- .editorconfig | 13 +++++++++++++ .prettierrc.js | 10 ++++++++++ package.json | 1 + 3 files changed, 24 insertions(+) create mode 100644 .editorconfig create mode 100644 .prettierrc.js diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..7f098647 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] # 表示所有文件适用 +charset = utf-8 # 设置文件字符集为 utf-8 +indent_style = space # 缩进风格(tab | space) +indent_size = 2 # 缩进大小 +end_of_line = lf # 控制换行类型(lf | cr | crlf) +trim_trailing_whitespace = true # 去除行首的任意空白字符 +insert_final_newline = true # 始终在文件末尾插入一个新行 + +[*.md] # 表示仅 md 文件适用以下规则 +max_line_length = off # 关闭最大行长度限制 +trim_trailing_whitespace = false # 关闭末尾空格修剪 diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 00000000..5ae39e1a --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,10 @@ +// @see https://prettier.io/docs/en/options +module.exports = { + singleQuote: true, + printWidth: 100, + tabWidth: 2, + useTabs: false, + semi: false, + trailingComma: 'all', + endOfLine: 'auto', +} diff --git a/package.json b/package.json index 1a60bc98..a0ded193 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "uni-preset-vue", "version": "0.0.0", + "type": "commonjs", "scripts": { "dev:app": "uni -p app", "dev:app-android": "uni -p app-android",