Add code formatting with prettier.
This commit is contained in:
parent
6ed07b4beb
commit
83d5f24371
4
.prettierignore
Normal file
4
.prettierignore
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
package.json
|
||||||
|
package-lock.json
|
||||||
|
yarn.lock
|
||||||
|
dist
|
9
.prettierrc
Normal file
9
.prettierrc
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"useTabs": false,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"singleQuote": true,
|
||||||
|
"printWidth": 100,
|
||||||
|
"semi": true,
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"arrowParens": "always"
|
||||||
|
}
|
22019
package-lock.json
generated
22019
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
13
package.json
13
package.json
@ -9,6 +9,8 @@
|
|||||||
"build:dev": "ng build -c dev",
|
"build:dev": "ng build -c dev",
|
||||||
"build:prod": "ng build --prod",
|
"build:prod": "ng build --prod",
|
||||||
"test:dev": "ng test",
|
"test:dev": "ng test",
|
||||||
|
"format:check": "prettier --config ./.prettierrc --list-different \"src/{app,environments,assets}/**/*.{ts,js,json,css,scss}\"",
|
||||||
|
"format:change": "prettier --config ./.prettierrc --write \"src/{app,environments,assets}/**/*.{ts,js,json,css,scss}\"",
|
||||||
"lint": "ng lint",
|
"lint": "ng lint",
|
||||||
"e2e": "ng e2e",
|
"e2e": "ng e2e",
|
||||||
"postinstall": "node patch-webpack.js"
|
"postinstall": "node patch-webpack.js"
|
||||||
@ -62,6 +64,7 @@
|
|||||||
"@types/node": "^12.20.6",
|
"@types/node": "^12.20.6",
|
||||||
"codelyzer": "^6.0.0",
|
"codelyzer": "^6.0.0",
|
||||||
"dotenv": "^8.2.0",
|
"dotenv": "^8.2.0",
|
||||||
|
"husky": "^6.0.0",
|
||||||
"jasmine-core": "~3.6.0",
|
"jasmine-core": "~3.6.0",
|
||||||
"jasmine-spec-reporter": "~5.0.0",
|
"jasmine-spec-reporter": "~5.0.0",
|
||||||
"karma": "~5.0.0",
|
"karma": "~5.0.0",
|
||||||
@ -70,11 +73,21 @@
|
|||||||
"karma-jasmine": "~4.0.0",
|
"karma-jasmine": "~4.0.0",
|
||||||
"karma-jasmine-html-reporter": "^1.5.0",
|
"karma-jasmine-html-reporter": "^1.5.0",
|
||||||
"karma-junit-reporter": "^2.0.1",
|
"karma-junit-reporter": "^2.0.1",
|
||||||
|
"prettier": "^2.3.0",
|
||||||
|
"pretty-quick": "^3.1.0",
|
||||||
"protractor": "~7.0.0",
|
"protractor": "~7.0.0",
|
||||||
"secp256k1": "^4.0.2",
|
"secp256k1": "^4.0.2",
|
||||||
"ts-node": "~8.3.0",
|
"ts-node": "~8.3.0",
|
||||||
"tslint": "~6.1.0",
|
"tslint": "~6.1.0",
|
||||||
|
"tslint-angular": "^3.0.3",
|
||||||
|
"tslint-config-prettier": "^1.18.0",
|
||||||
|
"tslint-jasmine-rules": "^1.6.1",
|
||||||
"typescript": "~4.0.2",
|
"typescript": "~4.0.2",
|
||||||
"yargs": "^13.3.2"
|
"yargs": "^13.3.2"
|
||||||
|
},
|
||||||
|
"husky": {
|
||||||
|
"hooks": {
|
||||||
|
"pre-commit": "pretty-quick --staged & ng lint"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"extends": "tslint:recommended",
|
"extends": [
|
||||||
|
"tslint:recommended",
|
||||||
|
"tslint-angular",
|
||||||
|
"tslint-config-prettier",
|
||||||
|
"tslint-jasmine-rules"
|
||||||
|
],
|
||||||
"rulesDirectory": [
|
"rulesDirectory": [
|
||||||
"codelyzer"
|
"codelyzer"
|
||||||
],
|
],
|
||||||
@ -53,7 +58,7 @@
|
|||||||
],
|
],
|
||||||
"no-empty": false,
|
"no-empty": false,
|
||||||
"no-inferrable-types": [
|
"no-inferrable-types": [
|
||||||
true,
|
false,
|
||||||
"ignore-params"
|
"ignore-params"
|
||||||
],
|
],
|
||||||
"no-non-null-assertion": true,
|
"no-non-null-assertion": true,
|
||||||
|
Loading…
Reference in New Issue
Block a user