Skip to content

Commit

Permalink
Formatting: add prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed May 26, 2021
1 parent fdeb37d commit 115672c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 5 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/prettier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Prettier formatting
on: [push, pull_request]

jobs:
build:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '16.x'
- run: npm ci
- run: npm run format:check
10 changes: 10 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.swp
*~
.*.haste_cache.*
.DS_Store
npm-debug.log
/build
/out
/gh-pages
/node_modules
/package.json
24 changes: 19 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@
"test": "npm run test:build && npm run test:spellcheck",
"test:build": "spec-md spec/GraphQL.md > /dev/null",
"test:spellcheck": "cspell 'spec/**/*.md' README.md",
"format": "prettier --write '**/*.{md,yml,yaml,json}'",
"format:check": "prettier --check '**/*.{md,yml,yaml,json}'",
"build": "mkdir -p out; spec-md --githubSource 'https://github.com/graphql/graphql-spec/blame/main/' spec/GraphQL.md > out/index.html",
"watch": "nodemon -e json,md --exec 'npm run build'"
},
"devDependencies": {
"cspell": "5.3.12",
"nodemon": "2.0.7",
"prettier": "^2.3.0",
"spec-md": "3.0.2"
},
"prettier": {
"proseWrap": "always",
"trailingComma": "none"
}
}

0 comments on commit 115672c

Please sign in to comment.