Explorar o código

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

https://github.com/transloadit/uppy/commit/c8d16f6a55fd1a5928f36e04defb8915693e3ad4

* use built in cache for the other lint too
Mikael Finstad hai 5 meses
pai
achega
bff5265333
Modificáronse 3 ficheiros con 5 adicións e 29 borrados
  1. 1 5
      .eslintrc.js
  2. 3 23
      .github/workflows/linters.yml
  3. 1 1
      package.json

+ 1 - 5
.eslintrc.js

@@ -54,11 +54,7 @@ module.exports = {
       ignore: svgPresentationAttributes,
     }],
 
-    // Special rules for CI:
-    ...(process.env.CI && {
-      // Some imports are available only after a full build, which we don't do on CI.
-      'import/no-unresolved': 'off',
-    }),
+    'import/no-unresolved': 'off',
 
     // rules we want to enforce
     'array-callback-return': 'error',

+ 3 - 23
.github/workflows/linters.yml

@@ -17,6 +17,7 @@ on:
 
 env:
   YARN_ENABLE_GLOBAL_CACHE: false
+  SKIP_YARN_COREPACK_CHECK: true
 
 jobs:
   lint_js:
@@ -25,22 +26,12 @@ jobs:
     steps:
       - name: Checkout sources
         uses: actions/checkout@v4
-      - name: Get yarn cache directory path
-        id: yarn-cache-dir-path
-        run:
-          echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
 
-      - uses: actions/cache@v4
-        id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
-        with:
-          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
-          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
-          restore-keys: |
-            ${{ runner.os }}-yarn-
       - name: Install Node.js
         uses: actions/setup-node@v4
         with:
           node-version: lts/*
+          cache: yarn
       - name: Install dependencies
         # List all projects that use a custom ESLint config:
         run:
@@ -57,22 +48,11 @@ jobs:
     steps:
       - name: Checkout sources
         uses: actions/checkout@v4
-      - name: Get yarn cache directory path
-        id: yarn-cache-dir-path
-        run:
-          echo "dir=$(corepack yarn config get cacheFolder)" >> $GITHUB_OUTPUT
-
-      - uses: actions/cache@v4
-        id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
-        with:
-          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
-          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
-          restore-keys: |
-            ${{ runner.os }}-yarn-
       - name: Install Node.js
         uses: actions/setup-node@v4
         with:
           node-version: lts/*
+          cache: yarn
       - name: Install dependencies
         run: corepack yarn workspaces focus @uppy-dev/build
       - name: Run linter

+ 1 - 1
package.json

@@ -118,7 +118,7 @@
     "build:angular": "yarn workspace angular build",
     "build:js:typeless": "npm-run-all build:lib build:companion build:svelte",
     "build:js": "npm-run-all build:js:typeless build:locale-pack build:angular build:bundle",
-    "build:ts": "yarn workspaces list --no-private --json | yarn tsc -b && yarn workspace @uppy/svelte check",
+    "build:ts": "yarn tsc -b && yarn workspace @uppy/svelte check",
     "build:lib": "yarn node ./bin/build-lib.js",
     "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",
     "build": "npm-run-all --serial build:ts --parallel build:js build:css --serial size",