Skip to content

feat: enhance ESLint configuration with import order and directive formatting#84

Merged
misterbridge merged 3 commits intomainfrom
feat/import-order
Sep 5, 2025
Merged

feat: enhance ESLint configuration with import order and directive formatting#84
misterbridge merged 3 commits intomainfrom
feat/import-order

Conversation

@misterbridge
Copy link
Collaborator

@misterbridge misterbridge commented Sep 4, 2025

Summary

  • Add eslint-plugin-import with import order rules for consistent import organization
  • Add JavaScript/TypeScript directive formatting rules for consistent code structure
  • Update documentation to clarify local development configuration files

Changes

Import Organization

  • Configure import/order rule with alphabetical sorting and consistent spacing
  • Force blank lines between import groups for better readability
  • Add path groups for custom import patterns (e.g., @/** paths)

Directive Formatting

  • Add padding-line-between-statements rule to enforce consistent directive formatting
  • Force blank line after directives ("use strict", "use client", "use server")
  • Prevent blank lines between consecutive directives to keep them grouped together

Documentation Improvements

  • Add Development section to README explaining local config files are dev-only
  • Update CLAUDE.md with detailed dual ESLint configuration explanation
  • Document that root config files are not exported and should not be used as examples

Test Plan

  • Build completes without warnings (npm run build)
  • ESLint runs successfully with new rules
  • Import ordering works correctly with alphabetical sorting
  • Directive formatting enforces proper spacing (tested with "use client", "use server")
  • Documentation accurately reflects repository structure and usage

🤖 Generated with Claude Code

@misterbridge misterbridge requested a review from a team as a code owner September 4, 2025 08:56
@misterbridge misterbridge self-assigned this Sep 4, 2025
@misterbridge misterbridge marked this pull request as draft September 4, 2025 11:13
@misterbridge misterbridge changed the base branch from main to chore/fix-types September 4, 2025 12:41
@misterbridge misterbridge changed the title feat(eslint): import/order feat: enhance ESLint configuration with import order and directive formatting Sep 4, 2025
@misterbridge misterbridge marked this pull request as ready for review September 4, 2025 20:49
Base automatically changed from chore/fix-types to main September 5, 2025 08:41
misterbridge and others added 3 commits September 5, 2025 10:41
…nitions

- Added `eslint-plugin-import` to enforce import order
  - Configured `import/order` rule with alphabetization and custom path group for `@/**`
- Updated ESLint config to lint `.d.ts` files in `types/`
- Added TypeScript declaration file for `eslint-plugin-import`
- Minor import order adjustments in `shared.config.ts` and test rules
- Updated `tsconfig.json` to include type definitions in `types/`
- Add Development section to README explaining root config files are local-only
- Update CLAUDE.md with detailed explanation of dual ESLint configuration
- Document that tsconfig.json, eslint.config.ts, and .prettierrc.js are for
  repository development only and not exported in the package
- Add guidance for fixing TypeScript/ESLint issues in this repository

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ives

- Force blank line after directives ("use strict", "use client", "use server")
- Prevent blank lines between consecutive directives to keep them grouped
- Applies to all JS/TS files for consistent directive formatting

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@misterbridge misterbridge merged commit 155d0dd into main Sep 5, 2025
3 checks passed
@misterbridge misterbridge deleted the feat/import-order branch September 5, 2025 08:42
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