add husky for prettier

This commit is contained in:
Vishwas Shashidhar
2021-01-29 11:41:05 +05:30
parent f1a0c840ec
commit 91dba95cbd
2 changed files with 24 additions and 39 deletions

View File

@@ -137,6 +137,7 @@
"gulp-less": "4.0.1", "gulp-less": "4.0.1",
"gulp-sourcemaps": "2.6.4", "gulp-sourcemaps": "2.6.4",
"gulp-typescript": "5.0.1", "gulp-typescript": "5.0.1",
"husky": "^4.3.8",
"jest": "25.2.4", "jest": "25.2.4",
"jest-html-reporter": "3.0.0", "jest-html-reporter": "3.0.0",
"less": "3.8.1", "less": "3.8.1",
@@ -144,11 +145,13 @@
"node-abi": "^2.17.0", "node-abi": "^2.17.0",
"npm-run-all": "4.1.5", "npm-run-all": "4.1.5",
"prettier": "2.2.1", "prettier": "2.2.1",
"pretty-quick": "^3.1.0",
"robotjs": "0.6.0", "robotjs": "0.6.0",
"run-script-os": "1.0.7", "run-script-os": "1.0.7",
"spectron": "^11.0.0", "spectron": "^11.0.0",
"ts-jest": "25.3.0", "ts-jest": "25.3.0",
"tslint": "5.11.0", "tslint": "5.11.0",
"tslint-config-prettier": "^1.18.0",
"typescript": "3.9.7" "typescript": "3.9.7"
}, },
"dependencies": { "dependencies": {
@@ -183,5 +186,10 @@
"ignoredByWatcher": [ "ignoredByWatcher": [
"!lib/src/**/*.js" "!lib/src/**/*.js"
] ]
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
} }
} }

View File

@@ -1,59 +1,36 @@
{ {
"extends": [ "extends": ["tslint:latest", "tslint-config-prettier"],
"tslint:recommended"
],
"linterOptions": { "linterOptions": {
"exclude": [ "exclude": ["**/*.json"]
"**/*.json"
]
}, },
"rules": { "rules": {
"curly": true, "curly": true,
"eofline": true, "eofline": true,
"align": [ "align": [true, "parameters"],
true,
"parameters"
],
"class-name": true, "class-name": true,
"indent": [ "indent": [true, "spaces"],
true, "max-line-length": [true, 650],
"spaces"
],
"max-line-length": [
true,
650
],
"no-shadowed-variable": false, "no-shadowed-variable": false,
"no-trailing-whitespace": true, "no-trailing-whitespace": true,
"no-duplicate-variable": true, "no-duplicate-variable": true,
"no-var-keyword": true, "no-var-keyword": true,
"variable-name": [true, "ban-keywords", "check-format", "allow-leading-underscore", "allow-pascal-case"], "variable-name": [
true,
"ban-keywords",
"check-format",
"allow-leading-underscore",
"allow-pascal-case"
],
"no-empty": true, "no-empty": true,
"no-unused-expression": true, "no-unused-expression": true,
"no-use-before-declare": true, "no-use-before-declare": true,
"no-var-requires": true, "no-var-requires": true,
"only-arrow-functions": true, "only-arrow-functions": true,
"object-literal-sort-keys": false, "object-literal-sort-keys": false,
"no-console": [ "no-console": [true, "log", "error"],
true, "one-line": [true, "check-else", "check-whitespace", "check-open-brace"],
"log", "quotemark": [true, "single", "avoid-escape"],
"error" "semicolon": [true, "always"],
],
"one-line": [
true,
"check-else",
"check-whitespace",
"check-open-brace"
],
"quotemark": [
true,
"single",
"avoid-escape"
],
"semicolon": [
true,
"always"
],
"typedef-whitespace": [ "typedef-whitespace": [
true, true,
{ {