mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
Bump husky & lint-staged and prevent translation edits (#13392)
This commit is contained in:
parent
33ce27de02
commit
eb4dbef610
4
.husky/pre-commit
Executable file
4
.husky/pre-commit
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
. "$(dirname -- "$0")/_/husky.sh"
|
||||||
|
|
||||||
|
lint-staged --relative --shell "/bin/bash"
|
@ -1,4 +1,11 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
"*.{js,ts}": 'eslint --ignore-pattern "**/build-scripts/**/*.js" --fix',
|
"*.{js,ts}": [
|
||||||
"!(/translations)*.{js,ts,json,css,md,html}": "prettier --write",
|
"prettier --write",
|
||||||
|
'eslint --ignore-pattern "**/build-scripts/**/*.js" --fix',
|
||||||
|
],
|
||||||
|
"!(/translations)*.{json,css,md,html}": "prettier --write",
|
||||||
|
"translations/*/*.json": (files) =>
|
||||||
|
'printf "%s\n" "These files should not be modified. Instead, make the necessary modifications in src/translations/en.json. Please see translations/README.md for details." ' +
|
||||||
|
files.join(" ") +
|
||||||
|
" >&2 && exit 1",
|
||||||
};
|
};
|
||||||
|
13
package.json
13
package.json
@ -16,6 +16,9 @@
|
|||||||
"lint:lit": "lit-analyzer \"**/src/**/*.ts\" --format markdown --outFile result.md",
|
"lint:lit": "lit-analyzer \"**/src/**/*.ts\" --format markdown --outFile result.md",
|
||||||
"lint": "yarn run lint:eslint && yarn run lint:prettier && yarn run lint:types",
|
"lint": "yarn run lint:eslint && yarn run lint:prettier && yarn run lint:types",
|
||||||
"format": "yarn run format:eslint && yarn run format:prettier",
|
"format": "yarn run format:eslint && yarn run format:prettier",
|
||||||
|
"postinstall": "husky install",
|
||||||
|
"prepack": "pinst --disable",
|
||||||
|
"postpack": "pinst --enable",
|
||||||
"test": "instant-mocha --webpack-config ./test/webpack.config.js --require ./test/setup.js \"test/**/*.ts\""
|
"test": "instant-mocha --webpack-config ./test/webpack.config.js --require ./test/setup.js \"test/**/*.ts\""
|
||||||
},
|
},
|
||||||
"author": "Paulus Schoutsen <Paulus@PaulusSchoutsen.nl> (http://paulusschoutsen.nl)",
|
"author": "Paulus Schoutsen <Paulus@PaulusSchoutsen.nl> (http://paulusschoutsen.nl)",
|
||||||
@ -203,9 +206,9 @@
|
|||||||
"gulp-rename": "^2.0.0",
|
"gulp-rename": "^2.0.0",
|
||||||
"gulp-zopfli-green": "^3.0.1",
|
"gulp-zopfli-green": "^3.0.1",
|
||||||
"html-minifier": "^4.0.0",
|
"html-minifier": "^4.0.0",
|
||||||
"husky": "^1.3.1",
|
"husky": "^8.0.1",
|
||||||
"instant-mocha": "^1.3.1",
|
"instant-mocha": "^1.3.1",
|
||||||
"lint-staged": "^11.1.2",
|
"lint-staged": "^13.0.3",
|
||||||
"lit-analyzer": "^1.2.1",
|
"lit-analyzer": "^1.2.1",
|
||||||
"lodash.template": "^4.5.0",
|
"lodash.template": "^4.5.0",
|
||||||
"magic-string": "^0.25.7",
|
"magic-string": "^0.25.7",
|
||||||
@ -214,6 +217,7 @@
|
|||||||
"mocha": "^8.4.0",
|
"mocha": "^8.4.0",
|
||||||
"object-hash": "^2.0.3",
|
"object-hash": "^2.0.3",
|
||||||
"open": "^7.0.4",
|
"open": "^7.0.4",
|
||||||
|
"pinst": "^3.0.0",
|
||||||
"prettier": "^2.4.1",
|
"prettier": "^2.4.1",
|
||||||
"require-dir": "^1.2.0",
|
"require-dir": "^1.2.0",
|
||||||
"rollup": "^2.8.2",
|
"rollup": "^2.8.2",
|
||||||
@ -246,11 +250,6 @@
|
|||||||
"@lit/reactive-element": "1.2.1"
|
"@lit/reactive-element": "1.2.1"
|
||||||
},
|
},
|
||||||
"main": "src/home-assistant.js",
|
"main": "src/home-assistant.js",
|
||||||
"husky": {
|
|
||||||
"hooks": {
|
|
||||||
"pre-commit": "lint-staged"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"prettier": {
|
"prettier": {
|
||||||
"trailingComma": "es5",
|
"trailingComma": "es5",
|
||||||
"arrowParens": "always"
|
"arrowParens": "always"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user