diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100644 index 0000000..0a4b97d --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1 @@ +npx --no -- commitlint --edit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..17f33fe --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +pretty-quick --staged diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..9da4aed --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +dist +CHANGELOG.md +package-lock.json +README.md +coverage diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..c91e66d --- /dev/null +++ b/.prettierrc @@ -0,0 +1 @@ +"@map-colonies/prettier-config" diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000..81f5db6 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,6 @@ +module.exports = { + extends: ['@commitlint/config-conventional'], + rules: { + 'scope-enum': [2, 'always', ['deps', 'dev-deps', 'configurations', 'error-handler']], + }, +}; diff --git a/package.json b/package.json index 02ed3e5..1fc78da 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,23 @@ "publishConfig": { "access": "public" }, + "scripts": { + "prepare": "husky", + "format": "prettier --check .", + "format:fix": "prettier --write ." + }, "files": [ "tsconfig-base.json", "tsconfig-app.json", "tsconfig-library.json" - ] + ], + "devDependencies": { + "husky": "9.1.7", + "prettier": "^3.3.3", + "pretty-quick": "^4.0.0", + "@commitlint/cli": "^19.5.0", + "@commitlint/config-conventional": "^19.5.0", + "@map-colonies/prettier-config": "^0.0.1", + "commitlint": "^19.5.0" + } }