npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@dyb-dev/prettier-config

v0.0.5

Published

Prettier 配置

Downloads

250

Readme

@dyb-dev/prettier-config

@dyb-dev/prettier-config 是一个全面的 Prettier 配置包,支持 JavaScript、TypeScript、Vue、Jsonc、JsDoc格式化检查,且额外支持 Html、Markdown、.d.ts格式化检查。此包旨在为你的项目提供统一和一致的编码风格。

安装

使用以下命令安装此包,具体取决于你使用的包管理器:

# 使用 npm
npm install @dyb-dev/prettier-config -D

# 使用 pnpm
pnpm add @dyb-dev/prettier-config -D

# 使用 yarn
yarn add @dyb-dev/prettier-config -D

使用方法

在你的 Prettier 配置文件中扩展此配置。你可以在 .prettierrc.mjs.prettierrc.cjs 文件中进行配置:

.prettierrc.mjs 文件示例

import prettierConfig from "@dyb-dev/prettier-config"
export default prettierConfig

.prettierrc.cjs 文件示例

const prettierConfig = require("@dyb-dev/prettier-config")
module.exports = prettierConfig

功能支持

  • JavaScript 格式化: 支持对普通 JavaScript 文件的代码规范检查。
  • TypeScript 格式化检查: 确保你的 TypeScript 代码符合规范,但请注意,你需要额外安装 typescript 依赖(npm install typescript -D)。
  • Vue 文件格式化: 内置对 Vue 文件的支持,确保你的 Vue 组件代码风格统一。
  • Jsonc 文件格式化: 支持 JSON with Comments 格式的文件格式化。
  • JsDoc 格式化: 确保你的代码注释符合规范,提升代码可读性。
  • Html 文件格式化: 支持 HTML 文件的格式化,确保网页结构清晰规范。
  • Markdown 文件格式化: 提供对 Markdown 文件的格式化支持,确保文档内容易读且统一。
  • .d.ts 文件格式化: 针对 TypeScript 的类型声明文件进行格式化,确保类型定义清晰一致。

常见问题

安装包后无法使用格式化

如果在安装 @dyb-dev/prettier-config 后无法使用格式化功能,可能是因为编辑器尚未加载新的配置。解决方法是 重启 编辑器,然后重新尝试格式化操作。