@eng618/prettier-config
v2.10.0
Published
My personal Prettier config
Readme
@eng618/prettier-config
A highly opinionated, yet sensible Prettier configuration with built-in support for imports organization, package.json sorting, and JSDoc formatting.
✨ Features
- Built-in Plugins:
prettier-plugin-organize-imports: Automatically sorts and removes unused imports.prettier-plugin-packagejson: Keeps yourpackage.jsonclean and consistently sorted.prettier-plugin-jsdoc: Formats JSDoc comments for better readability.
- Sensible Defaults:
printWidth: 120for modern screens.singleQuote: truefor clean JavaScript/TypeScript.trailingComma: 'all'for cleaner git diffs.- Standardized indentation (2 spaces) and line endings (LF).
- TypeScript Ready: Includes full type definitions for IntelliSense.
- Hybrid Support: Works with both ESM and CommonJS.
🚀 Installation
# Using npm
npm install --save-dev @eng618/prettier-config prettier
# Using yarn
yarn add --dev @eng618/prettier-config prettier
# Using pnpm
pnpm add --save-dev @eng618/prettier-config prettier[!TIP] All plugins (
organize-imports,packagejson,jsdoc) are included as dependencies, so you don't need to install them manually!
🛠 Usage
Simple Setup (package.json)
The easiest way to use this config is by referencing it in your package.json:
{
"name": "my-cool-project",
"prettier": "@eng618/prettier-config"
}Advanced Setup (prettier.config.js)
If you need to override or extend the config, create a prettier.config.js (or .prettierrc.js) file:
ES Modules (Recommended)
import eng618Config from '@eng618/prettier-config';
/** @type {import('prettier').Config} */
export default {
...eng618Config,
// Your overrides here
semi: false,
};CommonJS
const eng618Config = require('@eng618/prettier-config');
/** @type {import('prettier').Config} */
module.exports = {
...eng618Config,
// Your overrides here
semi: false,
};📝 Scripts
Add these to your package.json for easy formatting:
"scripts": {
"format": "prettier --write .",
"lint:format": "prettier --check ."
}📄 License
Contributors ✨
Thanks goes to these wonderful people (emoji key):
