Skip to content

Commit

Permalink
Added husky to auto lint TypeScript code (pre-commit)
Browse files Browse the repository at this point in the history
  • Loading branch information
BeardedFish committed Aug 13, 2023
1 parent 7931827 commit e7610ee
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh

. "$(dirname -- "$0")/_/husky.sh"

npm run lint:fix
24 changes: 23 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,29 @@
},
"main": "./dist/extension.js",
"scripts": {
"prepare": "husky install",
"vscode:prepublish": "npm run package",
"compile": "webpack",
"watch": "webpack --watch",
"package": "webpack --mode production --devtool hidden-source-map",
"lint": "eslint src --ext ts"
"compile": "npx webpack",
"watch": "npx webpack --watch",
"package": "npx webpack --mode production --devtool hidden-source-map",
"lint": "npx eslint src --ext ts",
"lint:fix": "npm run lint -- --fix"
},
"devDependencies": {
"@types/vscode": "^1.81.0",
"@types/glob": "^8.1.0",
"@types/mocha": "^10.0.1",
"@types/node": "20.2.5",
"@types/vscode": "^1.81.0",
"@typescript-eslint/eslint-plugin": "^5.59.8",
"@typescript-eslint/parser": "^5.59.8",
"@vscode/test-electron": "^2.3.2",
"eslint": "^8.41.0",
"glob": "^8.1.0",
"husky": "^8.0.3",
"mocha": "^10.2.0",
"typescript": "^5.1.3",
"ts-loader": "^9.4.3",
"typescript": "^5.1.3",
"webpack": "^5.85.0",
"webpack-cli": "^5.1.1",
"@vscode/test-electron": "^2.3.2"
"webpack-cli": "^5.1.1"
}
}

0 comments on commit e7610ee

Please sign in to comment.