Skip to content

Build: Fix ejslint execution path in lint-staged#33504

Merged
ndelangen merged 2 commits into
storybookjs:nextfrom
Yeonny0723:yeonny0723/issue-33433
Jan 13, 2026
Merged

Build: Fix ejslint execution path in lint-staged#33504
ndelangen merged 2 commits into
storybookjs:nextfrom
Yeonny0723:yeonny0723/issue-33433

Conversation

@Yeonny0723
Copy link
Copy Markdown
Contributor

@Yeonny0723 Yeonny0723 commented Jan 10, 2026

Related Issues #33433

What I did

Updated the lint-staged configuration for .ejs files.

Previously, the configuration relied on a hardcoded physical path (../scripts/node_modules/.bin/ejslint), which caused failures in the development environment depending on Yarn's dependency hoisting strategy (e.g., when dependencies are hoisted to the root or when using PnP).

I replaced the hardcoded path with yarn --cwd ../scripts ejslint. This leverages Yarn's resolution mechanism to reliably locate and execute the ejslint binary regardless of the underlying directory structure.

Checklist for Contributors

Testing

This is an internal tooling fix, so no automated tests are applicable.

Manual testing

  1. Navigate to any directory containing .ejs files (e.g., code/lib/cli/src/automigrate/templates).
  2. Make a trivial change to an .ejs file (e.g., add a whitespace).
  3. Stage the file: git add <path-to-file>.
  4. Run yarn lint-staged manually in the root, or attempt to commit via git commit.
  5. Verify that ejslint runs successfully without throwing a "No such file or directory" error regarding the executable path.
Screenshot 2026-01-10 at 6 40 26 PM

Documentation

Internal build script change, no documentation update required.

Summary by CodeRabbit

  • Chores
    • Updated linting configuration to streamline EJS file linting via project scripts, improving consistency of lint runs.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 10, 2026

📝 Walkthrough

Walkthrough

Changed lint-staged configuration in code/package.json to run EJS linting via the Yarn scripts entry (invoking yarn ejslint) instead of calling the ejslint binary via a direct path.

Changes

Cohort / File(s) Summary
Configuration Updates
code/package.json
Adjusted lint-staged rule for *.ejs to call ejslint through Yarn scripts (e.g., yarn ejslint) rather than using a direct bin path invocation.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between baded86 and 4401664.

📒 Files selected for processing (1)
  • code/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • code/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Core Unit Tests, windows-latest

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @code/package.json:
- Around line 55-57: The lint-staged entry for "*.ejs" currently uses "yarn
--cwd ../scripts ejslint" which runs ejslint from the scripts/ directory causing
file path mismatches; update the "*.ejs" command so ejslint executes with the
same working directory that lint-staged provides (or make it accept absolute
paths) — e.g., run ejslint from code/ (so the incoming relative paths like
builders/... resolve), or invoke a small wrapper that changes to the repo
root/scripts directory while passing the original lint-staged file arguments
unchanged; modify the package.json lint-staged "*.ejs" entry accordingly to
ensure ejslint receives valid paths.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c88b660 and baded86.

📒 Files selected for processing (1)
  • code/package.json
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{js,jsx,ts,tsx,json,md,html,css,scss}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Format code using Prettier with yarn prettier --write <file>

Files:

  • code/package.json
**/*.{js,jsx,json,html,ts,tsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Run ESLint checks using yarn lint:js:cmd <file> or the full command cross-env NODE_ENV=production eslint --cache --cache-location=../.cache/eslint --ext .js,.jsx,.json,.html,.ts,.tsx,.mjs --report-unused-disable-directives to fix linting errors before committing

Files:

  • code/package.json
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-22T22:03:40.123Z
Learning: Applies to **/*.{js,jsx,json,html,ts,tsx,mjs} : Run ESLint checks using `yarn lint:js:cmd <file>` or the full command `cross-env NODE_ENV=production eslint --cache --cache-location=../.cache/eslint --ext .js,.jsx,.json,.html,.ts,.tsx,.mjs --report-unused-disable-directives` to fix linting errors before committing
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-22T22:03:40.123Z
Learning: Applies to **/*.{js,jsx,ts,tsx,json,md,html,css,scss} : Format code using Prettier with `yarn prettier --write <file>`
📚 Learning: 2025-12-22T22:03:40.123Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-22T22:03:40.123Z
Learning: Applies to **/*.{js,jsx,json,html,ts,tsx,mjs} : Run ESLint checks using `yarn lint:js:cmd <file>` or the full command `cross-env NODE_ENV=production eslint --cache --cache-location=../.cache/eslint --ext .js,.jsx,.json,.html,.ts,.tsx,.mjs --report-unused-disable-directives` to fix linting errors before committing

Applied to files:

  • code/package.json
📚 Learning: 2025-12-22T22:03:40.123Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-22T22:03:40.123Z
Learning: Applies to **/*.{js,jsx,ts,tsx,json,md,html,css,scss} : Format code using Prettier with `yarn prettier --write <file>`

Applied to files:

  • code/package.json
📚 Learning: 2025-12-22T22:03:40.123Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-22T22:03:40.123Z
Learning: Use Node.js 22.21.1 (see `.nvmrc`) and Yarn 4.9.1 for development

Applied to files:

  • code/package.json

Comment thread code/package.json
@Sidnioulz Sidnioulz added bug build Internal-facing build tooling & test updates labels Jan 12, 2026
@ndelangen ndelangen changed the title chore: fix ejslint execution path in lint-staged Build: Fix ejslint execution path in lint-staged Jan 13, 2026
@ndelangen ndelangen merged commit 4f4da7c into storybookjs:next Jan 13, 2026
62 of 66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug build Internal-facing build tooling & test updates ci:normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants