diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..4cde4c7 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @vertexvis/platform diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..63912e2 --- /dev/null +++ b/.github/workflows/main.yml @@ -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" diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..e617454 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,6 @@ +module.exports = { + trailingComma: "es5", + tabWidth: 2, + semi: true, + singleQuote: false, +}; diff --git a/README.md b/README.md index 8b6bd4d..4a16d5c 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/package.json b/package.json new file mode 100644 index 0000000..d7b0fa8 --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "name": "@vertexvis/prettier-config", + "version": "1.0.0", + "description": "Vertex's shared Prettier config.", + "main": ".prettierrc.js", + "repository": "git@github.com:Vertexvis/prettier-config.git", + "author": "Dan Schultz ", + "bugs": { + "url": "https://github.com/vertexvis/prettier-config/issues" + }, + "homepage": "https://github.com/vertexvis/prettier-config#readme", + "license": "MIT" +}