Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export and use a new function: fixNibbles() (#91)
Commit dfd4439 added support for ESLint 8. `nibbleOnFile()` was updated to add in the roll-up statistics, but that change missed the fact that `eslint-filtered-fix.fix()` also no longer includes the roll-up statistics. This PR exports a new function called `fixNibbles()` which calls `fix()` and then adds in the roll-up statistics using the existing `calculateStatsPerRun()` function. The call to `fix()` could have been kept within the `cli` module, but that would have required bigger changes to copy/move/export `calculateStatsPerRun()` for use in there, so this seems like the simplest solution. This wasn't picked up by the tests as auto-fix is only available in interactive mode, and there are no tests for interactive mode. Adding support for testing interactive mode would require investigation and more time than I have available, so there are still no tests for this. This change can be tested easily by running `eslint-nibble` interactively against a file with auto-fixable errors. Fixes #90
- Loading branch information