1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-10 08:15:25 +02:00

chore(project): add prettier for code format (#3645)

* chore(project): install prettier and lint-staged

* chore(project): apply prettier to html too

* chore(project): git ignore eslintcache

* chore(project): add a comment about format script

* chore(prettier): update printWidth

* chore(prettier): remove useTabs option

* chore(prettier): add HTML validation

* refactor(prettier): fix closing tags

* feat(prettier): define angular parser for html templates

* style(prettier): run prettier on codebase

Co-authored-by: Anthony Lapenna <lapenna.anthony@gmail.com>
This commit is contained in:
Chaim Lev-Ari 2020-04-11 00:54:53 +03:00 committed by GitHub
parent 6663073be1
commit cf5056d9c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
714 changed files with 31228 additions and 28305 deletions

View file

@ -29,7 +29,8 @@
"start:client": "grunt clean:client && grunt start:client",
"dev:client": "grunt clean:client && webpack-dev-server --config=./webpack/webpack.develop.js",
"build:server:offline": "cd ./api/cmd/portainer && CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags '-s' && mv -f portainer ../../../dist/portainer",
"clean:all": "grunt clean:all"
"clean:all": "grunt clean:all",
"format": "prettier --loglevel warn --write \"**/*.{js,css,html}\""
},
"scriptsComments": {
"build": "Build the entire app (backend/frontend) in development mode",
@ -39,7 +40,8 @@
"start": "Build the entire app (backend/frontend) in development mode, run it inside a container locally and start a watch process for the frontend files",
"start:server": "Build the backend and run it inside a container",
"clean:all": "Deprecated. Use the clean script instead",
"build:server:offline": "Deprecated. Use the build:server script instead"
"build:server:offline": "Deprecated. Use the build:server script instead",
"format": "Should be removed before pr is merged"
},
"engines": {
"node": ">= 0.8.4"
@ -120,12 +122,15 @@
"gruntify-eslint": "^3.1.0",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
"husky": ">=4",
"image-webpack-loader": "^4.5.0",
"lint-staged": ">=10",
"load-grunt-tasks": "^3.5.2",
"lodash-webpack-plugin": "^0.11.5",
"mini-css-extract-plugin": "^0.4.4",
"ngtemplate-loader": "^2.0.1",
"postcss-loader": "^3.0.0",
"prettier": "^2.0.2",
"speed-measure-webpack-plugin": "^1.2.3",
"style-loader": "^0.23.1",
"url-loader": "^1.1.1",
@ -137,5 +142,14 @@
},
"resolutions": {
"jquery": "^3.3.1"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": "eslint --cache --fix",
"*.{js,css,md, html}": "prettier --write"
}
}