pretty-quick

⚡ Get Pretty Quick
授权协议 MIT License
开发语言 JavaScript
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 姜俊友
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

pretty-quick

Get Pretty Quick

Runs Prettier on your changed files.

Supported source control managers:

  • Git
  • Mercurial

Install

With yarn:

yarn add --dev prettier pretty-quick

With npm:

npm install --save-dev prettier pretty-quick

Usage

With yarn:

yarn pretty-quick

With npx:

npx -p prettier@latest -p pretty-quick pretty-quick

Note: You can (should) change latest to a specific version of Prettier.

With npm:

  1. Add "pretty-quick": "pretty-quick" to the "scripts" section of package.json.
  2. npm run pretty-quick

Pre-Commit Hook

You can run pretty-quick as a pre-commit hook using husky.

For Mercurial have a look at husky-hg

yarn add --dev husky

In package.json, add:

"husky": {
  "hooks": {
    "pre-commit": "pretty-quick --staged"
  }
}

CLI Flags

--staged (only git)

Pre-commit mode. Under this flag only staged files will be formatted, and they will be re-staged after formatting.

Partially staged files will not be re-staged after formatting and pretty-quick will exit with a non-zero exit code. The intent is to abort the git commit and allow the user to amend their selective staging to include formatting fixes.

--no-restage (only git)

Use with the --staged flag to skip re-staging files after formatting.

--branch

When not in staged pre-commit mode, use this flag to compare changes with the specified branch. Defaults to master (git) / default (hg) branch.

--pattern

Filters the files for the given minimatch pattern.
For example pretty-quick --pattern "**/*.*(js|jsx)" or pretty-quick --pattern "**/*.js" --pattern "**/*.jsx"

--verbose

Outputs the name of each file right before it is proccessed. This can be useful if Prettier throws an error and you can't identify which file is causing the problem.

--bail

Prevent git commit if any files are fixed.

--check

Check that files are correctly formatted, but don't format them. This is useful on CI to verify that all changed files in the current branch were correctly formatted.

--no-resolve-config

Do not resolve prettier config when determining which files to format, just use standard set of supported file types & extensions prettier supports. This may be useful if you do not need any customization and see performance issues.

By default, pretty-quick will check your prettier configuration file for any overrides you define to support formatting of additional file extensions.

Example .prettierrc file to support formatting files with .cmp or .page extensions as html.

{
    "printWidth": 120,
    "bracketSpacing": false,
    "overrides": [
        {
            "files": "*.{cmp,page}",
            "options": {"parser": "html"}
        }
    ],
}

--ignore-path

Check an alternative file for ignoring files with the same format as .prettierignore.For example pretty-quick --ignore-path .gitignore

Configuration and Ignore Files

pretty-quick will respect your .prettierrc, .prettierignore, and .editorconfig files if you don't use --ignore-path . Configuration files will be found by searching up the file system. .prettierignore files are only found from the repository root and the working directory that the command was executed from.

  • yarn add @commitlint/config-conventional yarn add @commitlint/cli yarn add husky yarn add pretty-quick yarn add prettier 注意:最新版husky配置跟旧版本有差别~~~~~~~~~~~~~ https://www.npmjs.com/package/husky package.j

  •  Understanding modern Linux routing (and wg-quick) Published on February 27, 2021; updated on March 1, 2021 Back in the old days, I could just type route (or, later, ip route) in my Linux terminal and

 相关资料
  • python模块pprint用于为python中的各种数据对象提供正确的打印格式。 这些数据对象可以表示字典数据类型,甚至可以表示包含JSON数据的数据对象。 在下面的示例中,我们将看到在应用pprint模块之前和应用它之后数据的外观。 import pprint student_dict = {'Name': 'Tusar', 'Class': 'XII', 'Address': {

  • 到目前为止,我们已经使用AWK的print和printf函数在标准输出上显示数据。 但是printf比我们之前看到的要强大得多。 此函数借用C语言,在生成格式化输出时非常有用。 以下是printf语句的语法 - 语法 (Syntax) printf fmt, expr-list 在上面的语法中, fmt是一串格式规范和常量。 expr-list是与格式说明符对应的参数列表。 转义序列 (Esca

  • Pretty Checkbox 是一个纯 CSS 库,可以用来构建漂亮的复选框和单选按钮。 特性 基础 Shapes - 方形、曲线、圆形 Variants - 默认、填充、加粗 Colors - 主要、成功、信息、警告、危险 Color types - 实心、轮廓 Animations - 平滑、抖动、果冻、脉冲、旋转 Switch - iOS style - 轮廓、填充、苗条 响应式 无 Ja

  • Pretty Beautiful Javascript,這是安裝前看 jQuery 1.7.0 程式碼的效果: 這是安裝後的效果: 不過 javascript 檔案大一點跑起來就會很慢 XD

  • import "testing/quick" Package quick implements utility functions to help with black box testing. The testing/quick package is frozen and is not accepting new features. Index func Check(f interface{},

  • Follow these steps to install Handsontable: Install Create Initialize Alternative installation Step 1: Install There are many ways to install Handsontable, but we suggest using npm. Just type in the f