mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
chore: add pre-commit hook to run linter and tests
This commit is contained in:
parent
3011f86eda
commit
a08ac18a11
4
.github/workflows/ci.yaml
vendored
4
.github/workflows/ci.yaml
vendored
@ -11,8 +11,12 @@
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
name: build
|
||||
on: [push, pull_request]
|
||||
env:
|
||||
# Don't install Git hooks.
|
||||
HUSKY: 0
|
||||
jobs:
|
||||
license-check:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
26
.husky/install.js
Normal file
26
.husky/install.js
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
Copyright 2024 the JSDoc Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Skip Husky install in production and CI.
|
||||
|
||||
let husky;
|
||||
|
||||
if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
husky = (await import('husky')).default;
|
||||
console.log(husky());
|
||||
1
.husky/pre-commit
Normal file
1
.husky/pre-commit
Normal file
@ -0,0 +1 @@
|
||||
npm run default
|
||||
@ -4,6 +4,8 @@
|
||||
"append": ""
|
||||
},
|
||||
"ignore": [
|
||||
".husky/_/**/*",
|
||||
".husky/pre-commit",
|
||||
".parcel-cache",
|
||||
"**/.*",
|
||||
"!**/.*.js",
|
||||
|
||||
16
package-lock.json
generated
16
package-lock.json
generated
@ -42,6 +42,7 @@
|
||||
"eslint": "^8.57.0",
|
||||
"execa": "^8.0.1",
|
||||
"hereby": "^1.8.9",
|
||||
"husky": "^9.0.11",
|
||||
"jasmine": "^5.1.0",
|
||||
"jasmine-console-reporter": "^3.1.0",
|
||||
"js-green-licenses": "^4.0.0",
|
||||
@ -5216,6 +5217,21 @@
|
||||
"ms": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/husky": {
|
||||
"version": "9.0.11",
|
||||
"resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz",
|
||||
"integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"husky": "bin.mjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/typicode"
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.4.24",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
"eslint": "^8.57.0",
|
||||
"execa": "^8.0.1",
|
||||
"hereby": "^1.8.9",
|
||||
"husky": "^9.0.11",
|
||||
"jasmine": "^5.1.0",
|
||||
"jasmine-console-reporter": "^3.1.0",
|
||||
"js-green-licenses": "^4.0.0",
|
||||
@ -43,6 +44,7 @@
|
||||
"license-check": "node_modules/.bin/hereby license-check",
|
||||
"license-headers": "node_modules/.bin/hereby license-headers",
|
||||
"lint": "node_modules/.bin/hereby lint",
|
||||
"prepare": "node .husky/install.js",
|
||||
"test": "node_modules/.bin/hereby test"
|
||||
},
|
||||
"workspaces": [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user