From 583af8ad205ee5b864b1c2fa63ca836cf817b73e Mon Sep 17 00:00:00 2001 From: Daniel Freytag Date: Thu, 11 Mar 2021 08:13:41 +0100 Subject: [PATCH] applying prettier to this project as well, updating name --- .github/workflows/publish.yml | 27 ++++++++++++++++++++++ .gitignore | 1 + .prettierignore | 1 - .prettierrc.js | 3 +++ index.js | 22 +++++++++--------- package.json | 42 +++++++++++++++++------------------ readme.md | 13 +++++------ 7 files changed, 68 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 .prettierrc.js diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..a1b8d29 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,27 @@ +name: Publish package to Github + +on: + release: + types: [created] + +jobs: + github: + runs-on: ubuntu-latest + steps: + - name: 👀 Checkout repo + uses: actions/checkout@v2 + + - name: 🛠 Setup Node + uses: actions/setup-node@v2 + with: + node-version: '12.x' + registry-url: 'https://npm.pkg.github.com' + scope: '@swrlab' + + - name: 📦 Install Dependencies + run: npm install + + - name: 🚀 npm publish + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index e69de29..40b878d 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/.prettierignore b/.prettierignore index 7fc077f..5be2eea 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,3 @@ node_modules/ package-lock.json -package.json yarn.lock diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..0a78048 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,3 @@ +module.exports = { + ...require("./index"), +}; diff --git a/index.js b/index.js index 9c64874..0a24ae2 100644 --- a/index.js +++ b/index.js @@ -1,12 +1,12 @@ module.exports = { - printWidth: 120, // prettier recommends 80 (old Unix-Style) - tabWidth: 8, - useTabs: true, - semi: true, // default - singleQuote: true, - quoteProps: 'as-needed', // default - trailingComma: 'es5', // default since 2.0.0 - bracketSpacing: true, // default - arrowParens: 'always', // default since 2.0.0 - endOfLine: 'lf', // default since 2.0.0 -}; + printWidth: 120, // prettier recommends 80 (old Unix-Style) + tabWidth: 8, + useTabs: true, + semi: false, // default + singleQuote: true, + quoteProps: 'as-needed', // default + trailingComma: 'es5', // default since 2.0.0 + bracketSpacing: true, // default + arrowParens: 'always', // default since 2.0.0 + endOfLine: 'lf', // default since 2.0.0 +} diff --git a/package.json b/package.json index 5ad4a6d..96b7199 100644 --- a/package.json +++ b/package.json @@ -1,23 +1,21 @@ { - "name": "@swr/prettier-config", - "version": "0.0.1", - "description": "SWR Prettier config.", - "keywords": [ - "prettier" - ], - "files": [ - "index.js" - ], - "license": "ISC", - "author": "SWR audio lab ", - "main": "index.js", - "repository": { - "type": "git", - "url": "https://github.com/swrlab/swr-prettier-config" - }, - "license": "ISC", - "bugs": "https://github.com/swrlab/swr-prettier-config/issues", - "homepage": "https://github.com/swrlab/swr-prettier-config#readme", - "scripts": { - } -} + "name": "@swrlab/prettier-config", + "version": "0.1.0", + "description": "SWR Prettier config.", + "keywords": [ + "prettier" + ], + "files": [ + "index.js" + ], + "license": "ISC", + "author": "SWR Audio Lab ", + "main": "index.js", + "repository": { + "type": "git", + "url": "https://github.com/swrlab/swr-prettier-config" + }, + "bugs": "https://github.com/swrlab/swr-prettier-config/issues", + "homepage": "https://github.com/swrlab/swr-prettier-config#readme", + "scripts": {} +} \ No newline at end of file diff --git a/readme.md b/readme.md index 5106dfe..d602e35 100644 --- a/readme.md +++ b/readme.md @@ -2,23 +2,22 @@ ## Installation -1. Install npm package +Step 1: Install [npm package](https://www.npmjs.com/package/@swrlab/swr-prettier-config) ```shell -npm install @swr/prettier-config +npm install @swrlab/swr-prettier-config ``` -1. Include in `package.json`: +Step 2: Include in `package.json`: ```json { - "prettier": "@swr/prettier-config" + "prettier": "@swrlab/swr-prettier-config" } ``` -2. Or create a `.prettierrc.json` file with a link: +Or create a `.prettierrc.json` file with a link: ```json -"@swr/prettier-config" +"@swrlab/swr-prettier-config" ``` -