-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add inline fixer configuration support #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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
1376dc7 to
dd34df2
Compare
There was a problem hiding this 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
FixerConfiginterface andFixerItemunion type for better type safety - Updates configuration parsing to handle mixed string/object arrays in the
fixersproperty - 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 |
- 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]>
There was a problem hiding this 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 |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
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.
| 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`. | |
| */ |
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' |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
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.
| import * as path from 'path' |
.felixrc.json
Outdated
| "appendPaths": false | ||
| } | ||
| ], | ||
| "paths": ["src", "examples", "tests", "*.md", "jest.config.js", "test-felix.js"], |
Copilot
AI
Nov 7, 2025
There was a problem hiding this comment.
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.
| "paths": ["src", "examples", "tests", "*.md", "jest.config.js", "test-felix.js"], | |
| "paths": ["src/**", "examples/**", "tests/**", "**/*.md", "jest.config.js", "test-felix.js"], |
- 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]>
Implement a cleaner configuration format that eliminates the need to specify fixers twice. Users can now mix simple fixer names with inline configuration objects:
Example of new format:
{ "fixers": [ "eslint", { "name": "prettier", "command": ["yarn", "prettier:write:path"], "appendPaths": true } ] }