You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the PR - I appreciate your contribution, however auto fixing is something I have deliberately left out up to now.
I don't auto fix as fdescribe or fit are tools that you might want to use sometimes during local development, rather than obvious bugs. Imagine you have configured tslint --fix to run as part of your watch process and you decide to run a single spec with fit, then as soon as you save the change, tslint is going to helpfully "fix" that for you. Most of the rules with autofix options tend to fix obvious problems like whitespace, or bracket placement, or commas, etc.
I think your PR is a reasonable request though. Some people may want this to be auto fixed. Maybe they are only running tslint --fix in a pre-commit hook for example, or they will fix with their IDE.
I think all it needs is a bit more configuration. Something along the lines of:
"rules": {
"defocus": true, // same behaviour as now for backwards compatibility
"rules": {
"defocus": "fix" // will apply your fix, so the user can auto fix if running with the --fix flag
I can take a look at this when I get a chance, or if you want to update your PR then that would be great.
I'm not sure if "defocus": "fix" can work (is the first parameter readable?).
Another option is "defocus": [true, "fix"] .
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow to replace
fdescribebydescribe, andfitbyit.