build: Update formatting and linting

This commit is contained in:
Denys Dovhan
2022-04-26 17:01:15 +03:00
parent 9989a3b422
commit 5773ebd846
3 changed files with 500 additions and 782 deletions

4
.husky/pre-commit Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged

1251
package-lock.json generated
View File

File diff suppressed because it is too large Load Diff

View File

@@ -6,9 +6,11 @@
"wtfjs": "wtfjs.js"
},
"scripts": {
"precommit": "lint-staged",
"toc": "npx doctoc --github --title '# Table of Contents' --maxlevel 2 README*.md",
"format": "npx prettier --write '*.{json,js}'"
"format": "prettier --write --ignore-unknown .",
"test": "prettier --check --ignore-unknown .",
"release": "npx semantic-release",
"prepare": "husky install"
},
"repository": {
"type": "git",
@@ -32,9 +34,9 @@
"devDependencies": {
"@semantic-release/git": "^9.0.0",
"doctoc": "^2.1.0",
"husky": "^0.14.3",
"lint-staged": "^10.5.3",
"prettier": "^1.14.2",
"husky": "^7.0.4",
"lint-staged": "^12.4.0",
"prettier": "^2.6.2",
"semantic-release": "^17.3.7"
},
"dependencies": {
@@ -48,12 +50,21 @@
},
"lint-staged": {
"README*.md": [
"npm run toc"
"npm run toc",
"npm run format"
],
"*.{js,json}": [
"prettier --write"
"**/*": [
"npm run format"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"prettier": {
"embeddedLanguageFormatting": "off"
},
"release": {
"plugins": [
"@semantic-release/commit-analyzer",