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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lightfish/prettierconfig

v1.0.3

Published

prettier 配置文件

Readme

Prettier 的配置项

{
	"printWidth": 80,
	"tabWidth": 2,
	"useTabs": true,
	"semi": true,
	"singleQuote": true,
	"quoteProps": "as-needed",
	"jsxSingleQuote": false,
	"bracketSpacing": true,
	"jsxBracketSameLine": false,
	"arrowParens": "always",
	"trailingComma": "all",
	"objectCurlyNewline": "consistent",
	"overrides": [
		{
			"files": ".prettierrc",
			"options": {
				"parser": "json"
			}
		}
	]
}

这些是Prettier代码格式化工具的配置项,每个配置项的含义如下:

  • arrowParens: 在箭头函数中,当只有一个参数时是否需要括号。可选值有 alwaysavoid
  • bracketSameLine: 是否将对象或数组的左括号与第一个元素放在同一行。可选值有 truefalse
  • bracketSpacing: 是否在对象或数组的括号内添加空格。可选值有 truefalse
  • semi: 是否在语句末尾添加分号。可选值有 truefalse
  • singleQuote: 是否使用单引号。可选值有 truefalse
  • jsxSingleQuote: 在JSX中是否使用单引号。可选值有 truefalse
  • quoteProps: 对象属性名是否需要用引号括起来。可选值有 as-neededconsistentpreserve
  • trailingComma: 是否在多行结尾添加逗号。可选值有 nonees5all
  • singleAttributePerLine: 是否将每个属性都放在单独的行上。可选值有 truefalse
  • htmlWhitespaceSensitivity: HTML标记内的空格敏感度。可选值有 cssstrictignore
  • vueIndentScriptAndStyle: 是否缩进Vue组件中的 <script><style> 标签。可选值有 truefalse
  • proseWrap: 在Markdown文本中,如何换行。可选值有 alwaysneverpreserve
  • insertPragma: 是否在文件顶部插入一个特殊的注释,以表明该文件已经使用了Prettier进行格式化。可选值有 truefalse
  • printWidth: 每行最大字符数。默认为80。
  • requirePragma: 是否只对带有特定注释的文件进行格式化。可选值有 truefalse
  • tabWidth: 缩进使用的空格数。默认为2。
  • useTabs: 是否使用制表符进行缩进。可选值有 truefalse
  • embeddedLanguageFormatting: 是否自动格式化嵌入式代码块。可选值有 autooff、和 onWithoutIndent

使用

在项目中的 package.json 配置 prettier =》 你的 npm包名