@codegenius/format-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

@codegenius/format-plugin

运行 prettier 格式化代码风格, 仅支持命令模式;

使用场景: 用于替代 prettier --write, 功能雷同, 可以使用 API 模式来运行命令.

安装

npm i @codegenius/format-plugin -D
import { defineConfig } from "code-genius";
import { prettierFormatInstaller } from "@codegenius/format-plugin";

export default defineConfig({
  plugins: [
    prettierFormatInstaller({
      files: ["./src", "./scripts"],
    }),
  ],
});

使用

命令模式

# 格式化 src 文件夹下的文件
codeg format
# 格式化 src 和 components 文件夹下的文件
codeg format -p ./src -p ./components
选项 描述
-p, --pattern <pattern> 设置匹配规则

PS: 依赖 prettier CLI 模式, 同时对项目配置的 .prettierignore.prettierrc.json 生效.

Readme

Keywords

none

Package Sidebar

Install

npm i @codegenius/format-plugin

Weekly Downloads

0

Version

0.0.5

License

MIT

Unpacked Size

5.71 kB

Total Files

6

Last publish

Collaborators

  • zhangxin_n22