Skip to content

Commit

Permalink
Add scripts to package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
VirajP1002 committed Apr 9, 2024
1 parent b1d5e26 commit 4192aca
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@ lint: lint-go lint-templates lint-static
format: format-go format-static format-templates

format-go:
go fmt ./...
npm run format-go

lint-go:
golangci-lint run
npm run lint-go

lint-static:
npx prettier --check "static/**/*.{js,css}"
npx eslint static/javascript/*.js
npm run lint-static

format-static:
npx prettier "static/**/*.{js,css}" --write
npm run format-static

lint-templates:
djlint templates --lint
npm run lint-templates

format-templates:
djlint templates/*.html --reformat
npm run format-templates
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
"type": "git",
"url": "https://github.com/ONSdigital/eq-questionnaire-launcher"
},
"scripts": {
"lint": "npm run lint-go && npm run lint:static && npm run lint:static",
"lint-go": "golangci-lint run",
"lint-static": "prettier --check \"static/**/*.{js,css}\" && eslint \"static/javascript/*.js\"",
"lint-templates": "djlint templates --lint",
"format": "npm run format-go && npm run format-static && npm run format-templates",
"format-go":"go fmt ./...",
"format-static": "prettier \"static/**/*.{js,css}\" --write",
"format-templates": "djlint templates/*.html --reformat"

},
"devDependencies": {
"djlint": "^1.34.1",
"eslint": "^8.57.0",
Expand Down

0 comments on commit 4192aca

Please sign in to comment.