GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - FE-CodeGenius/codegenius-format-plugin: 运行 prettier 格式化代码风格

BranchesTags
Open more actions menu

Latest commit

 

History

15 Commits
15 Commits

Folders and files

NameName
Last commit message
Last commit date
scripts
scripts
 
 
src
src
 
 
.eslintrc.json
.eslintrc.json
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
.release-it.js
.release-it.js
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
codeg.config.mjs
codeg.config.mjs
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
rollup.config.mjs
rollup.config.mjs
 
 
scripts.config.json
scripts.config.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

@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 生效.

About

运行 prettier 格式化代码风格

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.