From 7a407bfb59e8aeca42d18aba5e4ee6ca6f1f8077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Oddsson?= Date: Tue, 24 Mar 2020 17:18:45 +0000 Subject: [PATCH 01/17] 0.0.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d10f3f5..3783004 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@github/prettier-config", - "version": "0.0.2", + "version": "0.0.3", "description": "Prettier config used at GitHub", "repository": "github/prettier-config", "keywords": [ From 030190b5658257536634852ae0c3def66835fd0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Oddsson?= Date: Wed, 25 Mar 2020 09:07:13 +0000 Subject: [PATCH 02/17] avoid arrow parens See: https://prettier.io/docs/en/options.html#arrow-function-parentheses --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index f4e6e08..9efa3f1 100644 --- a/index.js +++ b/index.js @@ -3,5 +3,6 @@ module.exports = { semi: false, singleQuote: true, bracketSpacing: false, - trailingComma: 'none' + trailingComma: 'none', + arrowParens: 'avoid' } From 4d1f23636e22ff98165aed3ec6aa142d335b8b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Oddsson?= Date: Wed, 25 Mar 2020 11:18:56 +0000 Subject: [PATCH 03/17] denote a files array in package.json --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 3783004..e7e8b6c 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,9 @@ "keywords": [ "prettier" ], + "files": [ + "index.js" + ], "license": "MIT", "author": "GitHub Inc.", "main": "index.js", From 22f08df232d441a63bd31d3e3e7b7857a42b4835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Oddsson?= Date: Wed, 25 Mar 2020 11:19:22 +0000 Subject: [PATCH 04/17] publish to github packages and npm --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e7e8b6c..643d5fb 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "license": "MIT", "author": "GitHub Inc.", "main": "index.js", - "publishConfig": { - "registry": "https://npm.pkg.github.com/" + "scripts": { + "postpublish": "npm publish --ignore-scripts --@github:registry='https://npm.pkg.github.com'" } } From 6dd3bddf3e739e8824ec701aa1fcf2093740f298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Oddsson?= Date: Wed, 25 Mar 2020 11:23:08 +0000 Subject: [PATCH 05/17] 0.0.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 643d5fb..0a20255 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@github/prettier-config", - "version": "0.0.3", + "version": "0.0.4", "description": "Prettier config used at GitHub", "repository": "github/prettier-config", "keywords": [ From f40f794d8c5d059484302f02c497185985bb158f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Oddsson?= Date: Mon, 28 Feb 2022 17:05:13 +0000 Subject: [PATCH 06/17] Add a .devcontainer Co-authored-by: Ned Schwartz --- .devcontainer/Dockerfile | 16 ++++++++++++++++ .devcontainer/devcontainer.json | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..43abf1a --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,16 @@ +# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.222.0/containers/javascript-node/.devcontainer/base.Dockerfile + +# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 16, 14, 12, 16-bullseye, 14-bullseye, 12-bullseye, 16-buster, 14-buster, 12-buster +ARG VARIANT="16" +FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT} + +# [Optional] Uncomment this section to install additional OS packages. +# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ +# && apt-get -y install --no-install-recommends + +# [Optional] Uncomment if you want to install an additional version of node using nvm +# ARG EXTRA_NODE_VERSION=10 +# RUN su node -c "source/usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}" + +# [Optional] Uncomment if you want to install more global node modules +# RUN su node -c "npm install -g " diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..bf736f9 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,32 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.222.0/containers/javascript-node +{ + "name": "Node.js", + "build": { + "dockerfile": "Dockerfile", + // Update 'VARIANT' to pick a Node version: 16, 14, 12. + // Append -bullseye or -buster to pin to an OS version. + // Use -bullseye variants on local arm64/Apple Silicon. + "args": { "VARIANT": "16" } + }, + + // Set *default* container specific settings.json values on container create. + "settings": {}, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "dbaeumer.vscode-eslint" + ], + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "yarn install", + + // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "node", + "features": { + "git": "latest" + } +} From 6ed92e4445076acd4e39bd44a84fe374d6a846b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Oddsson?= Date: Fri, 25 Mar 2022 15:53:42 +0000 Subject: [PATCH 07/17] Create .github/workflows/publish.yml --- .github/workflows/publish.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..c1b229d --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,24 @@ +name: Publish + +on: + release: + types: [created] + +jobs: + publish-npm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 14 + registry-url: https://registry.npmjs.org/ + cache: npm + - run: npm ci + - run: npm test + - run: npm version ${TAG_NAME} --git-tag-version=false + env: + TAG_NAME: ${{ github.event.release.tag_name }} + - run: npm whoami; npm --ignore-scripts publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} From 280b09ddcd9dd8e6b7e6bfd41dfe547f94ec7418 Mon Sep 17 00:00:00 2001 From: Artem Saveliev Date: Thu, 15 Sep 2022 16:22:48 -0700 Subject: [PATCH 08/17] Allow trailing commas --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 9efa3f1..a7ae736 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,6 @@ module.exports = { semi: false, singleQuote: true, bracketSpacing: false, - trailingComma: 'none', + trailingComma: 'es5', arrowParens: 'avoid' } From 2fa441558c492c625491555a405effc751c83c7b Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 30 Nov 2022 16:52:22 +0000 Subject: [PATCH 09/17] add package-lock --- package-lock.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..111d91b --- /dev/null +++ b/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "@github/prettier-config", + "version": "0.0.4", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "@github/prettier-config", + "version": "0.0.4", + "license": "MIT" + } + } +} From 10072e289ca9aea7b366166ef08876fb0c0022ae Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Wed, 30 Nov 2022 16:53:12 +0000 Subject: [PATCH 10/17] add codeowners --- CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 CODEOWNERS diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..e6bf555 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +* @github/web-systems-reviewers From f61aae0af47fe9b8cd58272c3003dda31ff6c597 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Thu, 1 Dec 2022 10:06:26 +0000 Subject: [PATCH 11/17] set trailing commas to all --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index a7ae736..c92394c 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,6 @@ module.exports = { semi: false, singleQuote: true, bracketSpacing: false, - trailingComma: 'es5', + trailingComma: 'all', arrowParens: 'avoid' } From 8fd1960c0db681522c815f7afb637ae92001959f Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Thu, 1 Dec 2022 10:24:22 +0000 Subject: [PATCH 12/17] add tests --- .gitignore | 1 + examples/one.ts | 23 +++++++++++++++++++++++ package-lock.json | 28 +++++++++++++++++++++++++++- package.json | 5 +++++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 examples/one.ts diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/examples/one.ts b/examples/one.ts new file mode 100644 index 0000000..3eda89b --- /dev/null +++ b/examples/one.ts @@ -0,0 +1,23 @@ +const obj = { + one: 1, + two: 2, + three: 3, +} + +;('this config avoids semicolons at the end of statements and uses single quotes for strings') + +async function heresAFunctionWhichSpansMulitpleLinesAnd( + that, + includes, + many, + args, + to, + demonstrait, + trailing, + func, + commas +) { + return obj +} + +const arrowFunctions = avoidParens => 1 diff --git a/package-lock.json b/package-lock.json index 111d91b..bc4be5c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,33 @@ "": { "name": "@github/prettier-config", "version": "0.0.4", - "license": "MIT" + "license": "MIT", + "devDependencies": { + "prettier": "^2.8.0" + } + }, + "node_modules/prettier": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", + "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + } + }, + "dependencies": { + "prettier": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.0.tgz", + "integrity": "sha512-9Lmg8hTFZKG0Asr/kW9Bp8tJjRVluO8EJQVfY2T7FMw9T5jy4I/Uvx0Rca/XWf50QQ1/SS48+6IJWnrb+2yemA==", + "dev": true } } } diff --git a/package.json b/package.json index 0a20255..b7962b4 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,11 @@ "author": "GitHub Inc.", "main": "index.js", "scripts": { + "test:update": "prettier --config ./index.js --write examples/", + "test": "prettier --config ./index.js --check examples/", "postpublish": "npm publish --ignore-scripts --@github:registry='https://npm.pkg.github.com'" + }, + "devDependencies": { + "prettier": "^2.8.0" } } From 642c9ce305a0521bbfad57655694c7a59a1ead0c Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Thu, 1 Dec 2022 10:27:52 +0000 Subject: [PATCH 13/17] add CI build step --- .github/workflows/test.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f5dc344 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,18 @@ +name: Node CI + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 18.x + uses: actions/setup-node@v1 + with: + node-version: 18.x + - name: npm install, build, and test + run: | + npm it + env: + CI: true From 9e3619e1661fac8706d83fc3f1dd1cfa993398d7 Mon Sep 17 00:00:00 2001 From: Keith Cirkel Date: Thu, 1 Dec 2022 11:08:19 +0000 Subject: [PATCH 14/17] update snapshot tests --- examples/one.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/one.ts b/examples/one.ts index 3eda89b..6ebaa43 100644 --- a/examples/one.ts +++ b/examples/one.ts @@ -15,7 +15,7 @@ async function heresAFunctionWhichSpansMulitpleLinesAnd( demonstrait, trailing, func, - commas + commas, ) { return obj } From b9c50e3d7c2c6ba0d638e33edcb28c3520604340 Mon Sep 17 00:00:00 2001 From: Tiago Botelho Date: Fri, 2 Dec 2022 12:54:53 +0000 Subject: [PATCH 15/17] Publish package to GHPR Since there are a few repositories in npm that are currently consuming GitHub scoped packages directly from GHPR, it'd be convenient if we could publish the latest version of our packages to both registries. --- .github/workflows/publish.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c1b229d..d5a3d25 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,3 +22,24 @@ jobs: - run: npm whoami; npm --ignore-scripts publish env: NODE_AUTH_TOKEN: ${{secrets.npm_token}} + + publish-github: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 14 + registry-url: https://npm.pkg.github.com + cache: npm + - run: npm ci + - run: npm test + - run: npm version ${TAG_NAME} --git-tag-version=false + env: + TAG_NAME: ${{ github.event.release.tag_name }} + - run: npm whoami; npm --ignore-scripts publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From ccbdafe146dd48a55d44012d0b1ff991fc3397ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20M=C3=B8ller=20Ellehauge?= Date: Tue, 6 Dec 2022 13:44:58 +0100 Subject: [PATCH 16/17] chore: Change version permanent development --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b7962b4..997778c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@github/prettier-config", - "version": "0.0.4", + "version": "0.0.0-development", "description": "Prettier config used at GitHub", "repository": "github/prettier-config", "keywords": [ From d760b3ae18db240365f8406545b89ef4724b31aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20M=C3=B8ller=20Ellehauge?= Date: Tue, 6 Dec 2022 13:45:30 +0100 Subject: [PATCH 17/17] chore: remove postpublish in scripts in favor of explicit workflow --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index 997778c..b71ecaa 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,7 @@ "main": "index.js", "scripts": { "test:update": "prettier --config ./index.js --write examples/", - "test": "prettier --config ./index.js --check examples/", - "postpublish": "npm publish --ignore-scripts --@github:registry='https://npm.pkg.github.com'" + "test": "prettier --config ./index.js --check examples/" }, "devDependencies": { "prettier": "^2.8.0"