Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

convert mocha-avoid-only rule to use walk function #688

Merged

Conversation

drexler
Copy link
Contributor

@drexler drexler commented Dec 19, 2018

PR checklist

Overview of change:

Updates the mocha-avoid-only rule to use the walk function.

ctx.addFailureAt(node.getStart(), text.length, Rule.FAILURE_STRING_CONTEXT);
break;

default: // required per tslint rules for switch statements.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Intentionally went with the switch statement over the if/elseif for clarity. The forced inclusion of default mars it, admittedly. I can switch to the if/else if if required.

Choose a reason for hiding this comment

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

+1 for getting rid of continuous .getText() calls!

@drexler
Copy link
Contributor Author

drexler commented Dec 19, 2018

build failure due to #684 😞

@IllusionMH IllusionMH added the PR: Waiting for Reviewer A repository maintainer should take a look at the pull request soon! label Dec 19, 2018
Copy link

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for this!

ctx.addFailureAt(node.getStart(), text.length, Rule.FAILURE_STRING_CONTEXT);
break;

default: // required per tslint rules for switch statements.

Choose a reason for hiding this comment

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

+1 for getting rid of continuous .getText() calls!

@JoshuaKGoldberg
Copy link

Build failures are pre-existing, unrelated and only on Node 6. #684

@JoshuaKGoldberg JoshuaKGoldberg merged commit 71cf21d into microsoft:master Dec 19, 2018
@drexler drexler deleted the convert-mocha-avoid-only-rule branch December 26, 2018 17:59
@IllusionMH IllusionMH added this to the 6.1.0-beta milestone Feb 19, 2019
apawast pushed a commit to lupine86/tslint-microsoft-contrib that referenced this pull request Feb 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PR: Waiting for Reviewer A repository maintainer should take a look at the pull request soon!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert all existing rules to use a walk function instead of extending AbstractRule
3 participants