Skip to content

Conversation

sheikhlimon
Copy link
Contributor

@sheikhlimon sheikhlimon commented Oct 5, 2025

Description

This PR adds ESLint and Prettier configuration to the project to ensure consistent code formatting and linting standards across all contributors. This setup provides automated code quality checks while remaining contributor-friendly with minimal, non-intrusive rules.

Fixes #787

Type of Change

  • New feature (e.g., new page, component, or functionality)
  • Bug fix (non-breaking change that fixes an issue)
  • UI/UX improvement (design, layout, or styling updates)
  • Performance optimization (e.g., code splitting, caching)
  • Documentation update (README, contribution guidelines, etc.)
  • Other (please specify):

Changes Made

Configuration Files Added

  • .eslintrc.cjs - ESLint configuration for JavaScript/TypeScript with React support

    • Minimal rule set focused on catching real errors
    • Disabled most style warnings to avoid overwhelming contributors
    • Configured for TypeScript, React, and Prettier compatibility
  • .prettierrc - Prettier formatting configuration

    • Double quotes for strings
    • 2-space indentation
    • 80 character line width
    • Semicolons enabled
  • .prettierignore - Excludes documentation files from formatting

    • Protects MDX/Markdown files from breaking
    • Ignores build outputs and dependencies

Scripts Added to package.json

  • npm run lint - Check for linting issues
  • npm run lint:fix - Auto-fix linting issues
  • npm run format - Format code files (JS/TS/JSON/CSS only)
  • npm run format:check - Check formatting without modifying files

Philosophy

This configuration prioritizes:

  • Contributor-friendliness - Only enforces formatting, not strict code rules
  • Minimal friction - Most warnings disabled to avoid confusion
  • Safety - Documentation files excluded to preserve MDX syntax
  • Consistency - Automatic formatting ensures uniform code style

Dependencies

"eslint": "8.57.1"
"@typescript-eslint/eslint-plugin": "8.45.0"
"@typescript-eslint/parser": "8.45.0"
"eslint-config-prettier": "10.1.8"
"eslint-plugin-prettier": "5.5.4"
"eslint-plugin-react": "7.37.5"
"prettier": "3.6.2"

Testing Done

  • npm install - All dependencies install correctly
  • npm run lint - Linting works without errors
  • npm run format - Formatting works without breaking code
  • npm run build - Build succeeds with new configuration
  • Verified .prettierignore prevents MDX files from being corrupted

For Reviewers

This PR only adds configuration files. No code has been reformatted - that will be done in a separate PR after this is merged to keep the diff reviewable.

For Contributors

After this PR is merged, contributors should run before committing:

npm run lint:fix && npm run format

Or set up VS Code with ESLint and Prettier extensions for automatic formatting on save
Instruction will be added in community/understand-lint-check.md

Checklist

  • My code follows the style guidelines of this project.
  • I have tested my changes across major browsers and devices
  • My changes do not generate new console warnings or errors .
  • I ran npm run build and attached screenshot(s) in this PR.
  • This is already assigned Issue to me, not an unassigned issue.

Copy link

vercel bot commented Oct 5, 2025

@sheikhlimon is attempting to deploy a commit to the recode Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

github-actions bot commented Oct 5, 2025

Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. The estimated time for response is 5–8 hrs.

In the meantime, please provide all necessary screenshots and make sure you run - npm build run , command and provide a screenshot, a video recording, or an image of the update you made below, which helps speed up the review and assignment. If you have questions, reach out to LinkedIn. Your contributions are highly appreciated!😊

Note: I maintain the repo issue every day twice at 8:00 AM IST and 9:00 PM IST. If your PR goes stale for more than one day, you can tag and comment on this same issue by tagging @sanjay-kv.

We are here to help you on this journey of open source. Consistent 20 contributions are eligible for sponsorship 💰

🎁 check our list of amazing people we sponsored so far: GitHub Sponsorship. ✨

📚Your perks for contribution to this community 👇🏻

  1. Get free Consultation use code recode50 to get free: Mentorship for free.

  2. Get the Ebook for free use code recode at checkout: Data Science cheatsheet for Beginners.

  3. Check out this weekly Newsletter: Sanjay's Newsletter.

If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊

Copy link

github-actions bot commented Oct 5, 2025

Synced data from Linked Issues

Labels:

  • enhancement
  • level 1
  • recode
  • hacktoberfest-accepted

Assignees:

  • sheikhlimon

Milestones:

  • recode:launch 3.0

@Adez017
Copy link
Member

Adez017 commented Oct 5, 2025

@sanjay-kv , need a look over here and may be @iitzIrFan can look .

@iitzIrFan iitzIrFan moved this to In Progress in @recode-web Oct 5, 2025
@iitzIrFan iitzIrFan added the under review Review under the maintainers or the admins label Oct 5, 2025
@iitzIrFan iitzIrFan self-requested a review October 5, 2025 13:42
@sheikhlimon
Copy link
Contributor Author

Thanks for reviewing this! Let me know if you’d like me to tweak anything.

@iitzIrFan iitzIrFan added the don't-merge faced conflict issue or other dev related issue, dont merge PR label Oct 6, 2025
Copy link
Member

@iitzIrFan iitzIrFan left a comment

Choose a reason for hiding this comment

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

@sheikhlimon I tried running the Eslint as follows,
npm run lint
npm run lint:fix
npm run format

and as per our codebase it caught impressive 180 changes which, cannot be directly released in prod. So was thinking that, it would be great if, you make a new PR after running Eslint to be reviewed and merged.

For this you can cherry pick from this PR to get those Eslint tests !

Image

@sheikhlimon
Copy link
Contributor Author

sheikhlimon commented Oct 6, 2025

@sheikhlimon I tried running the Eslint as follows, npm run lint npm run lint:fix npm run format

and as per our codebase it caught impressive 180 changes which, cannot be directly released in prod. So was thinking that, it would be great if, you make a new PR after running Eslint to be reviewed and merged.

For this you can cherry pick from this PR to get those Eslint tests !

Image

done @iitzIrFan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
don't-merge faced conflict issue or other dev related issue, dont merge PR hacktoberfest-accepted level 1 10 points recode this is label for leaderboard under review Review under the maintainers or the admins
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

💡[Feature]: Add ESLint and Prettier for consistent code quality
3 participants