Skip to content
This repository has been archived by the owner on Sep 21, 2021. It is now read-only.

[API-2267] Prettier config #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @vertexvis/platform
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Main

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Checkout changes"
uses: actions/checkout@v2
- name: Setup NodeJS
uses: actions/setup-node@v1
- name: "Install"
run: "yarn install"
- uses: JS-DevTools/npm-publish@v1
with:
token: "${{ secrets.NPMJS_ACCESS_TOKEN }}"
access: "public"
6 changes: 6 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
trailingComma: "es5",
tabWidth: 2,
semi: true,
singleQuote: false,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For you @therockstorm :)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

These are all just the default values now so is this repo needed?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then we can just delete .prettierrc.json files and call it a day!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, I haven't taken a look at the defaults in awhile.. settings like trailingComma used to default to none, which I always changed to es5. I'll archive this project for now, so we can resurrect it if we disagree with something in Prettier.

};
43 changes: 41 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,41 @@
# prettier-config
Vertex's shared config for Prettier.
# @vertexvis/prettier-config

Vertex's shared Prettier config.

## Usage

This is based on [Shared
Configurations](https://prettier.io/docs/en/configuration.html#sharing-configurations)
in Prettier's documentation.

1. Remove any existing `.prettierrc` files.
2. Install the config.
```
yarn add --dev @vertexvis/prettier-config

# or

npm install -D @vertexvis/prettier-config
```
3. Update your `package.json` to reference the shared config.
```
"prettier": "@vertexvis/prettier-config",
```

## Overrides

If you'd like to override any of the default settings, add a `.prettierrc.js`
file in your project with any settings that you'd like to change:

```js
module.exports = {
...require("@vertexvis/prettier-config"),
semi: false,
};
```

## Publishing to NPM

To publish a release to NPM, run `yarn version` to update the major or minor
version. Commit your changes and open a PR. Once the PR is merged, the new
version will be published to NPM.
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "@vertexvis/prettier-config",
"version": "1.0.0",
"description": "Vertex's shared Prettier config.",
"main": ".prettierrc.js",
"repository": "[email protected]:Vertexvis/prettier-config.git",
"author": "Dan Schultz <[email protected]>",
"bugs": {
"url": "https://github.com/vertexvis/prettier-config/issues"
},
"homepage": "https://github.com/vertexvis/prettier-config#readme",
"license": "MIT"
}