Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken lint on CI #5507

Merged
merged 7 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the setup-node action supports caching built in, so we can remove all this

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
Loading