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 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" } }