My Prettier config preset
Tip: For an enhanced development experience, it's recommended to use this Prettier configuration in conjunction with @shinlms404/eslint-config. Check out the eslint-config repository for more details.
npm install @shinlms404/prettier-config --save-devIn your project's prettier.config.js file:
import prettierConfigs from '@shinlms404/prettier-config'
export default prettierConfigs()| Name | Description | Default |
|---|---|---|
| sortPackageJson | Sort the keys of a package.json | true |
| organizeImports | The import can automatically sort and remove unused imports | true |
- Opinionated Prettier configuration
- Supports TypeScript
- Integrates with eslint for a consistent code style
This configuration includes the following plugins:
Tip: You need to install
@antfu/niandpnpmfirst, otherwise some of the scripts may not work!
Install
npm install @antfu/ni -g
npm install pnpm -gnpm run build: Build the project using tsupnpm run lint: Run ESLintnpm run lint:fix: Run ESLint with the --fix optionnpm run prepack: Run nr buildnpm run prepare: Set up simple-git-hooksnpm run release: Bump the version and publish to npmnpm run stub: Build a TypeScript stub using tsupnpm run test: Run vitest for testingnpm run typecheck: Run TypeScript type checkingnpm run watch: Watch for changes using tsup
Feel free to open issues and submit pull requests. Contributions are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.