Skip to content

Commit

Permalink
Fix broken lint on CI (#5507)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mifi authored Nov 11, 2024
1 parent 38126a1 commit bff5265
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 29 deletions.
6 changes: 1 addition & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
26 changes: 3 additions & 23 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:

env:
YARN_ENABLE_GLOBAL_CACHE: false
SKIP_YARN_COREPACK_CHECK: true

jobs:
lint_js:
Expand All @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit bff5265

Please sign in to comment.