@flowplayer/playback-prettier-config
v0.0.1
Published
Shared prettier configuration made by the Playback team
Downloads
85
Maintainers
Keywords
Readme
@flowplayer/playback-prettier-config
This 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.
Table of Contents
Installation
You can install this configuration as a development dependency in your project by running:
yarn add -D @flowplayer/playback-prettier-config
or
npm install -D @flowplayer/playback-prettier-config
Usage
After installation, you can use this Prettier configuration by referencing it in your project's config files.
Using prettier.config.js
You can import and extend the configuration in your project's prettier.config.js
or prettier.config.cjs
by adding the following:
// prettier.config.js
import config from '@flowplayer/playback-prettier-config'
export default {
...config,
// Add any project-specific overrides here
}
Using package.json
Alternatively, reference it in your package.json
:
{
"prettier": "@flowplayer/playback-prettier-config"
}
Configuration Details
The shared configuration currently includes the following rules:
- trailingComma:
"es5"
- tabWidth:
2
- semi:
false
- singleQuote:
true
For more configuration options, refer to Prettier's documentation.
Contributing
Contributions are welcome! Please submit a pull request or open an issue if you have suggestions or improvements.
Publishing
This repository is configured with a GitHub Actions workflow, defined in the publish.yml file, to automatically publish the package to npm.
How It Works
- 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 version20.x
, and uses the associated npm registry URL. - It uses
yarn
to install dependencies and publish the package to npm. Note that for Yarn version 1, the script usesyarn publish
.
Prerequisites
- 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.
Steps to Publish
- Create a new release in your GitHub repository with the desired version tag.
- Once the release is published, the GitHub Action will automatically run and publish the package to npm using the provided npm registry URL.