Skip to content

Commit

Permalink
Merge pull request #14 from kg8m/check_formatted
Browse files Browse the repository at this point in the history
Check if files are formatted
  • Loading branch information
kg8m authored Nov 13, 2022
2 parents 2914665 + 61fc512 commit 84140df
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,15 @@ jobs:
cache: npm
- run: npm install
- run: make lint
timeout-minutes: 5
format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "19.0.0"
cache: npm
- run: npm install
- run: make format-check
timeout-minutes: 5
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ help: ## Show help
lint: ## Lint files
npm run lint

.PHONY: fix
fix: ## Format files
npm run fix
.PHONY: format
format: ## Format files
npm run format

.PHONY: format-check
format-check: ## Check if files are formatted
npm run format-check

.PHONY: update-major
update-major: ## Update the major version
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
},
"scripts": {
"lint": "eslint .*.js *.js",
"fix": "eslint --fix .*.js *.js && prettier --write .*.js *.js manifest.json package.json"
"format": "eslint --fix .*.js *.js && prettier --write .*.js *.js manifest.json package.json",
"format-check": "prettier --check .*.js *.js manifest.json package.json"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 84140df

Please sign in to comment.