Skip to content

Commit bff5265

Browse files
authored
Fix broken lint on CI (#5507)
* fix broken lint i'm currently getting errors with yarn lint locally, but CI is succeeding. meaning i always have to bypass commit hooks Unable to resolve path to module '@uppy/...' import/no-unresolved * use built in cache * skip corepack check * disable no-unresolved rule i don't think it's very necessary now that we have typescript * revert * remove remnants of refactor c8d16f6 * use built in cache for the other lint too
1 parent 38126a1 commit bff5265

File tree

3 files changed

+5
-29
lines changed

3 files changed

+5
-29
lines changed

.eslintrc.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ module.exports = {
5454
ignore: svgPresentationAttributes,
5555
}],
5656

57-
// Special rules for CI:
58-
...(process.env.CI && {
59-
// Some imports are available only after a full build, which we don't do on CI.
60-
'import/no-unresolved': 'off',
61-
}),
57+
'import/no-unresolved': 'off',
6258

6359
// rules we want to enforce
6460
'array-callback-return': 'error',

.github/workflows/linters.yml

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ on:
1717

1818
env:
1919
YARN_ENABLE_GLOBAL_CACHE: false
20+
SKIP_YARN_COREPACK_CHECK: true
2021

2122
jobs:
2223
lint_js:
@@ -25,22 +26,12 @@ jobs:
2526
steps:
2627
- name: Checkout sources
2728
uses: actions/checkout@v4
28-
- name: Get yarn cache directory path
29-
id: yarn-cache-dir-path
30-
run:
31-
echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
3229

33-
- uses: actions/cache@v4
34-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
35-
with:
36-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
37-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
38-
restore-keys: |
39-
${{ runner.os }}-yarn-
4030
- name: Install Node.js
4131
uses: actions/setup-node@v4
4232
with:
4333
node-version: lts/*
34+
cache: yarn
4435
- name: Install dependencies
4536
# List all projects that use a custom ESLint config:
4637
run:
@@ -57,22 +48,11 @@ jobs:
5748
steps:
5849
- name: Checkout sources
5950
uses: actions/checkout@v4
60-
- name: Get yarn cache directory path
61-
id: yarn-cache-dir-path
62-
run:
63-
echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
64-
65-
- uses: actions/cache@v4
66-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
67-
with:
68-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
69-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
70-
restore-keys: |
71-
${{ runner.os }}-yarn-
7251
- name: Install Node.js
7352
uses: actions/setup-node@v4
7453
with:
7554
node-version: lts/*
55+
cache: yarn
7656
- name: Install dependencies
7757
run: corepack yarn workspaces focus @uppy-dev/build
7858
- name: Run linter

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
"build:angular": "yarn workspace angular build",
119119
"build:js:typeless": "npm-run-all build:lib build:companion build:svelte",
120120
"build:js": "npm-run-all build:js:typeless build:locale-pack build:angular build:bundle",
121-
"build:ts": "yarn workspaces list --no-private --json | yarn tsc -b && yarn workspace @uppy/svelte check",
121+
"build:ts": "yarn tsc -b && yarn workspace @uppy/svelte check",
122122
"build:lib": "yarn node ./bin/build-lib.js",
123123
"build:locale-pack": "yarn workspace @uppy-dev/locale-pack build && eslint packages/@uppy/locales/src/en_US.ts --fix && yarn workspace @uppy-dev/locale-pack test unused",
124124
"build": "npm-run-all --serial build:ts --parallel build:js build:css --serial size",

0 commit comments

Comments
 (0)