0.1.0 • Published 3 months ago

@shinlms404/prettier-config v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

@shinlms404/prettier-config

npm version License: MIT

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.

Installation

npm install @shinlms404/prettier-config --save-dev

Usage

In your project's prettier.config.js file:

import prettierConfigs from '@shinlms404/prettier-config'

export default prettierConfigs()

Of course I also integrated two packages prettier-plugin-packagejson and prettier-plugin-organize-imports, which are true by default.

{
  // Sort the keys of a package.json
  sortPackageJson?: boolean
  // The import can automatically sort and remove unused imports
  organizeImports?: boolean
}

When you want to disable and not affect the default options

export default prettierConfigs({
  overrides: {
    options: {
      sortPackageJson: false,
      organizeImports: false
    }
  }
})

When you are using your own configuration and want to turn on these options

export default prettierConfigs({
  sortPackageJson: true,
  organizeImports: true,

  ...your own configuration
})

Features

  • Opinionated Prettier configuration
  • Supports TypeScript
  • Integrates with eslint for a consistent code style

Configuration

This configuration includes the following plugins:

Scripts

Tip: You need to install @antfu/ni and pnpm first, otherwise some of the scripts may not work!

Install

npm install @antfu/ni -g
npm install pnpm -g
  • pnpm run build: Build the project using tsup
  • pnpm run lint: Run ESLint
  • pnpm run lint:fix: Run ESLint with the --fix option
  • pnpm run prepack: Run nr build
  • pnpm run release: Bump the version and publish to npm
  • pnpm run stub: Build a TypeScript stub using tsup
  • pnpm test: Run vitest for testing
  • pnpm run typecheck: Run TypeScript type checking
  • pnpm run watch: Watch for changes using tsup

Contributing

Feel free to open issues and submit pull requests. Contributions are welcome!

License

This project is licensed under the MIT License - see the LICENSE file for details.

Links

0.1.0

3 months ago

0.0.4

3 months ago

0.0.1

4 months ago