Shared prettier configuration made by the Playback team
npm install @flowplayer/playback-prettier-configThis project provides a shared Prettier configuration for use across internal projects within the Playback team. It ensures consistent code formatting for JS/TS files in CI pipelines and local development.
- @flowplayer/playback-prettier-config
- Table of Contents
- Installation
- Usage
- Using prettier.config.js
- Using package.json
- Configuration Details
- Contributing
- Publishing
- How It Works
- Prerequisites
- Steps to Publish
You can install this configuration as a development dependency in your project by running:
``bash`
yarn add -D @flowplayer/playback-prettier-config
or
`bash`
npm install -D @flowplayer/playback-prettier-config
After installation, you can use this Prettier configuration by referencing it in your project's config files.
You can import and extend the configuration in your project's prettier.config.js or prettier.config.cjs by adding the following:
`js
// prettier.config.js
import config from '@flowplayer/playback-prettier-config'
export default {
...config,
// Add any project-specific overrides here
}
`
Alternatively, reference it in your package.json:
`json`
{
"prettier": "@flowplayer/playback-prettier-config"
}
The shared configuration currently includes the following rules:
- trailingComma: "es5"2
- tabWidth: false
- semi: true
- singleQuote:
For more configuration options, refer to Prettier's documentation.
Contributions are welcome! Please submit a pull request or open an issue if you have suggestions or improvements.
This repository is configured with a GitHub Actions workflow, defined in the publish.yml file, to automatically publish the package to npm.
- The workflow is triggered every time a new GitHub release is created in the repository.
- The workflow runs on ubuntu-latest, checks out the code, sets up Node.js with version 20.x, and uses the associated npm registry URL.yarn
- It uses to install dependencies and publish the package to npm. Note that for Yarn version 1, the script uses yarn publish.
- Ensure that you have the necessary secrets configured in your GitHub repository settings:
- NPM_TOKEN`: This should be an npm token with permission to publish to your desired npm scope or account.
1. Create a new release in your GitHub repository with the desired version tag.
2. Once the release is published, the GitHub Action will automatically run and publish the package to npm using the provided npm registry URL.