Skip to content

Add ESLint and Prettier Rules Config Files #2724

Open
@ImBIOS

Description

@ImBIOS

PROBLEM:
When working on collaborative codebases, developers often face inconsistencies in coding style and format. This can lead to unnecessary code review comments and difficulty maintaining a uniform code style.

SOLUTION:
Add configuration files for ESLint and Prettier to enforce consistent code quality and style across the project. Use the ESLint rules from the create-t3-app stack as a base, as they are well-optimized for modern TypeScript/JavaScript projects and include sensible defaults for strict linting and formatting.

ALTERNATIVES:

  1. Use only Prettier without ESLint for formatting, but it won't cover linting issues.
  2. Use a different linter like JSHint, but it lacks the community support and features of ESLint.
  3. Create custom ESLint rules from scratch, but aligning with best practices may take more effort.

RELEVANCE / SCOPE:
This would benefit nearly all developers working in JavaScript/TypeScript projects as consistent code style is a universal need. The create-t3-app rules are particularly relevant for projects using TypeScript.

"SIDE EFFECTS":
Some developers might need to update their local environment to align with the configured rules. Existing code might require reformatting to meet the enforced style, causing a one-time disruption.

CONTEXT:
Adding ESLint and Prettier configurations, specifically leveraging the create-t3-app rules, ensures that every contributor adheres to a unified coding standard. These rules provide strict but practical guidelines, improving collaboration, maintainability, and code quality.


SHORT Table (Summary)
Problem Inconsistent code style and quality in collaborative projects.
Solution Add ESLint and Prettier configuration files, using create-t3-app ESLint rules.
Alternatives Use Prettier alone, JSHint, or custom ESLint rules.
Scope Universal benefit for JavaScript/TypeScript projects, especially those using TypeScript and React.
Side effects Requires reformatting existing code and updating local setups.
Context Improves collaboration and maintainability with practical and strict rules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature requestWish or ideagood first issueA GitHub standard for inviting (new) contributors *Congratulations in advance!*help wantedJust an old github standard we add automatically. (The team can remove it when working on it.)up-for-grabs(a github standard for inviting new contributors) - Welcome! ♥

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions