Skip to content

Conversation

@zmdavis
Copy link
Contributor

@zmdavis zmdavis commented Aug 7, 2025

Implement a cleaner configuration format that eliminates the need to specify fixers twice. Users can now mix simple fixer names with inline configuration objects:

  • Add FixerConfig interface and FixerItem union type
  • Update configuration parsing to handle mixed string/object arrays
  • Maintain full backward compatibility with legacy format
  • Add comprehensive documentation with examples
  • Update all TypeScript types for better type safety

Example of new format:

{
  "fixers": [
    "eslint",
    {
      "name": "prettier",
      "command": ["yarn", "prettier:write:path"],
      "appendPaths": true
    }
  ]
}

zmdavis and others added 7 commits August 7, 2025 11:36
Implement a cleaner configuration format that eliminates the need to specify fixers twice. Users can now mix simple fixer names with inline configuration objects:

- Add FixerConfig interface and FixerItem union type
- Update configuration parsing to handle mixed string/object arrays
- Maintain full backward compatibility with legacy format
- Add comprehensive documentation with examples
- Update all TypeScript types for better type safety

Example of new format:
```json
{
  "fixers": [
    "eslint",
    {
      "name": "prettier",
      "command": ["yarn", "prettier:write:path"],
      "appendPaths": true
    }
  ]
}
```

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

Co-Authored-By: Claude <[email protected]>
Add comprehensive migration guide showing how to convert from the legacy format to the new inline fixer configuration format. Includes:

- Step-by-step migration instructions
- Before/after examples for common scenarios
- Quick reference mapping table
- Backward compatibility notes
- Complete real-world migration example

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

Co-Authored-By: Claude <[email protected]>
Update all .felixrc.json files and documentation examples to demonstrate the new inline fixer configuration format:

- Update root .felixrc.json to use inline format
- Update examples/.felixrc.json with comprehensive inline examples
- Update README.md configuration examples
- Add mixed format examples to show flexibility
- Maintain backward compatibility notes

This provides users with working examples of the new format while keeping the repository's own configuration up-to-date.
Add a simple .felixrc.json example alongside the advanced ones to show that basic usage remains clean and straightforward with the new inline format.

Shows progression from simple string array to advanced inline objects.
Rebuild the action distribution to include all TypeScript changes for the new inline fixer configuration format.
Resolve conflicts by accepting main branch changes in dist/ files.
Distribution will be rebuilt to include all inline fixer config changes.
Rebuild action distribution to include:
- Inline fixer configuration changes
- Latest main branch improvements (hasFailures field)
- Properly generated source maps
@zmdavis zmdavis force-pushed the feature/inline-fixer-config branch from 1376dc7 to dd34df2 Compare August 7, 2025 18:44
@zmdavis zmdavis requested a review from Copilot August 7, 2025 18:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a cleaner inline configuration format for Fix-it Felix that eliminates the need to specify fixers twice. Users can now mix simple fixer names with inline configuration objects while maintaining full backward compatibility with the legacy format.

  • Adds FixerConfig interface and FixerItem union type for better type safety
  • Updates configuration parsing to handle mixed string/object arrays in the fixers property
  • Provides comprehensive migration documentation and examples

Reviewed Changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/types.ts Refactors type definitions to support new FixerConfig interface and FixerItem union type
src/fixers/*.ts Updates fixer constructors to use strongly-typed FixerConfig instead of any
src/config.ts Implements parsing logic for new inline configuration format with legacy fallback
src/felix.ts Updates type annotations to use new FixerConfig type
examples/.felixrc.json Demonstrates new inline configuration format
docs/MIGRATION.md Comprehensive migration guide from legacy to inline format
docs/CONFIGURATION.md Updated documentation with examples of both formats
README.md Updated examples to showcase new inline configuration
.felixrc.json Migrated project's own configuration to new format

zmdavis and others added 4 commits August 7, 2025 12:14
- Remove redundant command fallback in BaseFixer (already validated by hasCustomCommand)
- Replace 'unnamed-fixer' fallback with proper error throwing for inline configs
- Add InlineFixerConfig type requiring name property for better type safety
- Add validation error handling in getFixers() method
- Update documentation to emphasize required name property
- Rebuild distribution with improvements
Rebuild action distribution to include:
- Inline fixer configuration feature with PR feedback addressed
- Latest main branch improvements and bug fixes
- Properly generated source maps with all changes combined
- Keep inline fixer configuration format in .felixrc.json
- Add missing type imports in config.ts and felix.ts
- Extend FixerConfig interface with oxlint-specific properties
- Rebuild distribution files

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

Co-Authored-By: Claude <[email protected]>
@zmdavis zmdavis requested a review from Copilot November 7, 2025 23:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 13 out of 15 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

extensions?: string[]
paths?: string[]
command?: string[]
appendPaths?: boolean
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

The env property for environment variables lacks documentation. Add a comment explaining that these environment variables are applied when executing custom commands.

Suggested change
appendPaths?: boolean
appendPaths?: boolean
/**
* Environment variables to set when executing custom commands.
* These variables are applied only during the execution of the command specified in `command`.
*/

Copilot uses AI. Check for mistakes.
src/config.ts Outdated
import * as core from '@actions/core'
import * as fs from 'fs'
import { FelixConfig, FelixInputs } from './types'
import * as path from 'path'
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

The path import is unused in this file and should be removed to keep imports clean.

Suggested change
import * as path from 'path'

Copilot uses AI. Check for mistakes.
.felixrc.json Outdated
"appendPaths": false
}
],
"paths": ["src", "examples", "tests", "*.md", "jest.config.js", "test-felix.js"],
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

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

[nitpick] The paths array includes specific file patterns (*.md, jest.config.js, test-felix.js) mixed with directory patterns. Consider using more consistent glob patterns like 'src/' and 'examples/' as shown in other examples for better maintainability.

Suggested change
"paths": ["src", "examples", "tests", "*.md", "jest.config.js", "test-felix.js"],
"paths": ["src/**", "examples/**", "tests/**", "**/*.md", "jest.config.js", "test-felix.js"],

Copilot uses AI. Check for mistakes.
- Add documentation for env property in FixerConfig interface
- Remove unused path import from src/config.ts
- Update glob patterns in .felixrc.json for consistency (src/** instead of src)
- Remove unused type imports to fix linting errors
- Rebuild distribution files

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

Co-Authored-By: Claude <[email protected]>
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.

3 participants