best-prettier-config
Advanced tools
Comparing version 1.1.0 to 2.0.0
{ | ||
"name": "best-prettier-config", | ||
"description": "The best prettier config in the world", | ||
"version": "1.1.0", | ||
"main": "index.json", | ||
"bin": "cli.js", | ||
"version": "2.0.0", | ||
"bin": { | ||
"best-prettier-config": "src/cli.ts" | ||
}, | ||
"type": "module", | ||
"files": [ | ||
"index.json", | ||
"cli.js" | ||
".prettierrc.json", | ||
"src/" | ||
], | ||
@@ -14,12 +16,31 @@ "keywords": [ | ||
], | ||
"author": "Mackie Underdown <macklinu@gmail.com>", | ||
"author": "Mackie Underdown <macklinu@users.noreply.github.com>", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/macklinu/best-prettier-config.git" | ||
"url": "git+https://github.com/macklinu/best-prettier-config.git" | ||
}, | ||
"homepage": "https://github.com/macklinu/best-prettier-config", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"test": "bun test", | ||
"lint": "eslint src" | ||
}, | ||
"dependencies": { | ||
"minimist": "^1.2.8", | ||
"zod": "^3.22.4" | ||
}, | ||
"devDependencies": { | ||
"prettier": "^1.15.2" | ||
"@changesets/cli": "^2.26.2", | ||
"@types/minimist": "^1.2.3", | ||
"@types/node": "^20.8.6", | ||
"@typescript-eslint/eslint-plugin": "^6.7.5", | ||
"@typescript-eslint/parser": "^6.7.5", | ||
"bun-types": "^1.0.6", | ||
"eslint": "^8.51.0", | ||
"eslint-plugin-simple-import-sort": "^10.0.0", | ||
"prettier": "^3" | ||
} | ||
} |
# best-prettier-config | ||
> The best [prettier][] config in the world | ||
> The best [prettier][] config in the world :earth_americas: | ||
I add this file to all my projects, so I made a CLI to make it easier to do so. | ||
```sh | ||
bunx best-prettier-config | ||
``` | ||
npx best-prettier-config | ||
``` | ||
> **Note:** As of v2, I use Bun to execute one-off scripts, so this module is only supported for usage with `bunx`. I try to keep APIs compatiable with Node and `npx` but it's not guaranteed. | ||
This will write a `.prettierrc` file with the following contents to your current working directory: | ||
@@ -22,8 +24,23 @@ | ||
If you really need it, you can also require this module: | ||
If you need to add a couple plugins, like working on an Astro project with Tailwind, you can use the `--plugin` command line argument: | ||
```js | ||
const config = require('best-prettier-config') | ||
```sh | ||
# These are all the same | ||
bunx best-prettier-config --plugin prettier-plugin-astro --plugin prettier-plugin-tailwind | ||
bunx best-prettier-config --plugin astro --plugin tailwind | ||
bunx best-prettier-config -p astro -p tailwind | ||
``` | ||
Example output: | ||
```json | ||
{ | ||
"jsxSingleQuote": true, | ||
"semi": false, | ||
"singleQuote": true, | ||
"trailingComma": "es5", | ||
"plugins": ["prettier-plugin-astro", "prettier-plugin-tailwind"] | ||
} | ||
``` | ||
[prettier]: https://github.com/prettier/prettier |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
5779
7
75
46
0
Yes
2
9
+ Addedminimist@^1.2.8
+ Addedzod@^3.22.4
+ Addedminimist@1.2.8(transitive)
+ Addedzod@3.23.8(transitive)