mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-15 13:26:34 +00:00
Enable cache in CI and locally for ESLint and Prettier (#17384)
This commit is contained in:
parent
c7cf49de05
commit
e21f951368
8
.github/workflows/ci.yaml
vendored
8
.github/workflows/ci.yaml
vendored
@ -36,6 +36,14 @@ jobs:
|
|||||||
run: yarn dedupe --check
|
run: yarn dedupe --check
|
||||||
- name: Build resources
|
- name: Build resources
|
||||||
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data gather-gallery-pages
|
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data gather-gallery-pages
|
||||||
|
- name: Setup lint cache
|
||||||
|
uses: actions/cache@v3.3.1
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
node_modules/.cache/prettier
|
||||||
|
node_modules/.cache/eslint
|
||||||
|
key: lint-${{ github.sha }}
|
||||||
|
restore-keys: lint-
|
||||||
- name: Run eslint
|
- name: Run eslint
|
||||||
run: yarn run lint:eslint --quiet
|
run: yarn run lint:eslint --quiet
|
||||||
- name: Run tsc
|
- name: Run tsc
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
export default {
|
export default {
|
||||||
"*.?(c|m){js,ts}": ["eslint --fix", "prettier --write"],
|
"*.?(c|m){js,ts}": [
|
||||||
"*.{json,css,md,markdown,html,y?aml}": "prettier --write",
|
"eslint --cache --cache-strategy=content --cache-location=node_modules/.cache/eslint/.eslintcache --fix",
|
||||||
|
"prettier --cache --write",
|
||||||
|
],
|
||||||
|
"*.{json,css,md,markdown,html,y?aml}": "prettier --cache --write",
|
||||||
"translations/*/*.json": (files) =>
|
"translations/*/*.json": (files) =>
|
||||||
'printf "%s\n" "Translation files should not be added or modified here. Instead, make the necessary modifications in src/translations/en.json. Other languages are managed externally. Please see https://developers.home-assistant.io/docs/translations/ for details." ' +
|
'printf "%s\n" "Translation files should not be added or modified here. Instead, make the necessary modifications in src/translations/en.json. Other languages are managed externally. Please see https://developers.home-assistant.io/docs/translations/ for details." ' +
|
||||||
files.join(" ") +
|
files.join(" ") +
|
||||||
|
@ -8,10 +8,10 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "script/build_frontend",
|
"build": "script/build_frontend",
|
||||||
"lint:eslint": "eslint \"**/src/**/*.{js,ts,html}\" --ignore-path .gitignore",
|
"lint:eslint": "eslint \"**/src/**/*.{js,ts,html}\" --cache --cache-strategy=content --cache-location=node_modules/.cache/eslint/.eslintcache --ignore-path=.gitignore",
|
||||||
"format:eslint": "eslint \"**/src/**/*.{js,ts,html}\" --fix --ignore-path .gitignore",
|
"format:eslint": "eslint \"**/src/**/*.{js,ts,html}\" --cache --cache-strategy=content --cache-location=node_modules/.cache/eslint/.eslintcache --ignore-path=.gitignore --fix",
|
||||||
"lint:prettier": "prettier . --check",
|
"lint:prettier": "prettier . --cache --check",
|
||||||
"format:prettier": "prettier . --write",
|
"format:prettier": "prettier . --cache --write",
|
||||||
"lint:types": "tsc",
|
"lint:types": "tsc",
|
||||||
"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",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user