Skip to content

Conversation

@sairamsharan
Copy link

@sairamsharan sairamsharan commented Oct 16, 2025

Pre-flight checklist

Motivation

This pull request adds the new no-hardcoded-src ESLint rule, as proposed in issue #6472. The goal is to prevent hardcoded image paths to ensure assets work correctly across different site configurations.

Difference from Previous PR

This is a new, clean pull request to replace my previous attempt in #11486.

My apologies for the messy state of the first PR. I wrote the initial implementation and tests myself, but I ran into some complex TypeScript errors with the RuleTester setup, specifically around the parser configuration.

To debug those errors, I used an AI assistant for help. While it fixed the type issue, it also incorrectly introduced many unrelated changes to configuration files (package.json, jest.config.js), which I failed to catch before submitting.

After reviewing your feedback, I researched the project's testing setup more carefully and found the correct pattern used by other ESLint rules in the repository. This new pull request contains only the two necessary files (the rule and its test) and is free of any unrelated configuration changes.

Test Plan

I've added a new test suite for the rule at packages/eslint-plugin/src/rules/__tests__/no-hardcoded-src.test.ts. All tests are passing locally after running yarn test, and the project builds successfully with yarn build.

@meta-cla meta-cla bot added the CLA Signed Signed Facebook CLA label Oct 16, 2025
@netlify
Copy link

netlify bot commented Oct 16, 2025

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit f782696
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/68f135cb35451800081ed385
😎 Deploy Preview https://deploy-preview-11489--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@sairamsharan
Copy link
Author

@slorber Just a friendly reminder about this PR. I would appreciate it if you could take a look when you have a moment. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant