Skip to content
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

Add a fix for the rule #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bastienmoulia
Copy link

Allow to replace fdescribe by describe, and fit by it.

@Sergiioo Sergiioo self-assigned this May 15, 2018
@Sergiioo
Copy link
Owner

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.

@bastienmoulia
Copy link
Author

OK.

I'm not sure if "defocus": "fix" can work (is the first parameter readable?).
Another option is "defocus": [true, "fix"] .

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.

None yet

2 participants