Skip to content

Add claudemd and update linting rules - #271

Merged
lukegrn merged 1 commit into
masterfrom
claudemd-linting
Aug 6, 2026
Merged

lukegrn merged 1 commit into
masterfrom
claudemd-linting

Conversation

@lukegrn

@lukegrn lukegrn commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

This adds claude md for ai assisted development, as well as ensures the auto formatting and linting config matches with our other apps. Linter has been run to fix formatting issues

Summary by Sourcery

Document project architecture and align code formatting with shared linting and Prettier rules.

Enhancements:

  • Reformat React components and utility functions to comply with updated linting and Prettier style guidelines.

Build:

  • Add Prettier configuration file to standardize code formatting across the project.

Documentation:

  • Add CLAUDE.md documenting project overview, architecture, commands, code style, and testing expectations.

@lukegrn
lukegrn requested a review from a team August 5, 2026 14:09
@sourcery-ai

sourcery-ai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR introduces a CLAUDE.md guide for AI-assisted development, aligns Prettier/ESLint formatting with other subscription apps, and applies those formatting rules across React components and utilities.

Flow diagram for updated linting and formatting workflow

flowchart LR
  Dev(Developer edits code)
  PrettierConfig(.prettierrc)
  ESLintConfig(eslint.config.js)
  LintCmd(npm run lint)
  VerifyCmd(npm run verify)
  BuildCmd(npm run build)
  TestCmd(npm run test)

  Dev --> PrettierConfig
  PrettierConfig --> ESLintConfig
  ESLintConfig --> LintCmd
  LintCmd --> VerifyCmd
  VerifyCmd --> BuildCmd
  VerifyCmd --> TestCmd
Loading

File-Level Changes

Change Details Files
Add CLAUDE.md documentation for project context and development conventions.
  • Document project overview, tech stack, and architecture flow (entry chain, Module Federation exposure).
  • List common npm scripts and how they map to CI/verification workflows.
  • Capture code style, linting, and testing conventions including ESLint/Prettier behavior and caveats about running inside the Insights Chrome shell.
CLAUDE.md
Align Prettier and linting rules with sibling apps and update code formatting accordingly.
  • Introduce a new .prettierrc to enforce shared formatting rules (single quotes, print width, trailing commas behavior, etc.).
  • Reformat React component imports and JSX props to match the new style (e.g., single-line imports, compact JSX where possible, adjusted trailing commas).
  • Normalize object literals and utility functions to the new trailing-comma and spacing rules in shared utilities.
.prettierrc
src/Components/BodyComponent.tsx
src/Components/Dropdown.tsx
src/Components/SubscriptionPortfolio.tsx
src/Components/TopCard.tsx
src/Components/SubscriptionOverview.tsx
src/utils/utils.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

This adds claude md for ai assisted development, as well as ensures the auto formatting and linting config matches with our other apps. Linter has been run to fix issues

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="src/utils/utils.ts" line_range="12" />
<code_context>
   return {
     ...to,
-    pathname: `${basename}/${to.pathname}`.replace(`^${basename}//`, '/'),
+    pathname: `${basename}/${to.pathname}`.replace(`^${basename}//`, '/')
   };
 };
</code_context>
<issue_to_address>
**issue (bug_risk):** The replace pattern is a plain string, so it won't behave like a regex and may not correctly normalize double slashes.

Because `replace` treats its first argument as a literal string, this only replaces the exact substring ``^${basename}//`` and won’t match “basename + double slash at the start” as a regex would. If you intend to handle leading double slashes or duplicate basenames, use a regex, e.g.

```ts
pathname: `${basename}/${to.pathname}`.replace(new RegExp(`^${basename}//`), '/')
```

or normalize by collapsing multiple slashes:

```ts
pathname: `${basename}/${to.pathname}`.replace(/\/+/g, '/')
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread src/utils/utils.ts
@lukegrn
lukegrn merged commit ec196ab into master Aug 6, 2026
7 checks passed
@lukegrn
lukegrn deleted the claudemd-linting branch August 6, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants