Skip to content
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
10 changes: 9 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ jobs:
lint:
name: ESLint check
if: ${{ github.event.head_commit.author.name != 'OSBotify' || github.event_name == 'push' }}
runs-on: blacksmith-4vcpu-ubuntu-2404
# A cold-cache run lints the whole repo with type-aware rules, which loads the full TypeScript
# program in every worker (~12GB of heap each, regardless of how files are split between workers).
# 2 workers with a 14GB heap cap need ~30GB of memory, so this requires the 32GB (8vcpu) runner.
runs-on: blacksmith-8vcpu-ubuntu-2404
steps:
- name: Checkout
uses: useblacksmith/checkout@1c9394c220d293645707b625ba9d79685f093a8f # v1
Expand Down Expand Up @@ -48,6 +51,11 @@ jobs:
# If lint fails, we clear the cache and retry to rule out false positives.
# See: https://typescript-eslint.io/troubleshooting/faqs/eslint/#can-i-use-eslints---cache-with-typescript-eslint
- name: Lint JavaScript and Typescript with ESLint
env:
# See the runs-on comment: each worker needs ~12GB of heap on a cold cache, so run
# 2 workers with a 14GB cap instead of ESLint's defaults (4 workers, 8GB cap).
ESLINT_CONCURRENCY: 2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why did you add ESLINT_CONCURRENCY: 2? The lint script currently uses --concurrency=auto

NODE_OPTIONS: --max_old_space_size=14336
Comment on lines +54 to +58

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This might be a temporal fix as right now ESLint's result cache hashes ${eslintVersion}_${nodeVersion}_${config} (node_modules/eslint/lib/cli-engine/lint-result-cache.js:50);, so the migration Node 20 → node 26 invalidates every cache entry forcing a lint of the entire repo, verified empirically: warm cache re-lint 5s on same Node, 62s (full) when Node 26 reads Node 20's cache.

We might be able to reverse this part when we start to cache under the new nodeVersion

run: |
if ! npm run lint; then
echo "Lint failed, clearing cache and retrying..."
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.20.2
26.5.0
4 changes: 3 additions & 1 deletion config/rsbuild/CustomVersionFilePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ const APP_VERSION = packageJson.version;
class CustomVersionFilePlugin {
apply(compiler: Compiler) {
compiler.hooks.done.tap(this.constructor.name, () => {
const versionPath = path.join(__dirname, '/../../dist/version.json');
// Node 26 loads the rsbuild TS config as native ESM, where CommonJS globals like
// __dirname don't exist, so resolve the dist directory from the compiler instead.
const versionPath = path.join(compiler.outputPath, 'version.json');

fs.promises
.mkdir(path.dirname(versionPath), {recursive: true})
Expand Down
Loading
Loading