Skip to content

Commit

Permalink
Merge pull request #6 from huuyafwww/feature/eslintcache
Browse files Browse the repository at this point in the history
Add ESLint Cache to lint-test workflow
  • Loading branch information
huuyafwww authored Nov 26, 2024
2 parents 1d5850b + 4ffc31f commit 6423efd
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 11 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,19 @@ jobs:
- name: Build packages
run: pnpm run build

- name: Setup ESLint cache
uses: actions/cache@v4
with:
path: |
packages/eslint-config-browser/.eslintcache
packages/eslint-config-common/.eslintcache
packages/eslint-config-next/.eslintcache
packages/eslint-config-node/.eslintcache
packages/eslint-config-react/.eslintcache
packages/eslint-config-storybook/.eslintcache
key: ${{ runner.os }}-eslint-cache-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-eslint-cache-
- name: Lint Code
run: pnpm run lint:code
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ yarn-error.log*

# Output
dist
.eslintcache
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"build": "turbo run build",
"build:watch": "turbo run build:watch",
"clean": "turbo run clean",
"lint:code": "turbo lint:code",
"sort:package": "sort-package-json && turbo run sort:package",
"lint:code": "turbo lint:code --parallel",
"sort:package": "sort-package-json && turbo run sort:package --parallel",
"version": "changeset",
"version:apply": "changeset version",
"version:publish": "changeset publish"
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"build": "pkgroll --minify",
"build:watch": "pkgroll --watch",
"clean": "rimraf node_modules",
"lint:code": "eslint .",
"lint:code": "eslint . --cache",
"sort:package": "sort-package-json"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"build": "pkgroll --minify",
"build:watch": "pkgroll --watch",
"clean": "rimraf node_modules",
"lint:code": "eslint .",
"lint:code": "eslint . --cache",
"sort:package": "sort-package-json"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"build": "pkgroll --minify",
"build:watch": "pkgroll --watch",
"clean": "rimraf node_modules",
"lint:code": "eslint .",
"lint:code": "eslint . --cache",
"sort:package": "sort-package-json"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"build": "pkgroll --minify",
"build:watch": "pkgroll --watch",
"clean": "rimraf node_modules",
"lint:code": "eslint .",
"lint:code": "eslint . --cache",
"sort:package": "sort-package-json"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"build": "pkgroll --minify",
"build:watch": "pkgroll --watch",
"clean": "rimraf node_modules",
"lint:code": "eslint .",
"lint:code": "eslint . --cache",
"sort:package": "sort-package-json"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"build": "pkgroll --minify",
"build:watch": "pkgroll --watch",
"clean": "rimraf node_modules",
"lint:code": "eslint .",
"lint:code": "eslint . --cache",
"sort:package": "sort-package-json"
},
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
"inputs": ["package.json"]
},
"sort:package": {
"dependsOn": ["^sort:package"],
"dependsOn": [],
"inputs": ["package.json"]
},
"lint:code": {
"dependsOn": ["^lint:code"],
"inputs": ["package.json"]
"dependsOn": [],
"inputs": ["**/*.ts", "**/*.js"]
}
}
}

0 comments on commit 6423efd

Please sign in to comment.