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

Fix: fails the test case if autofix made syntax error (fixes #11615) #11798

merged 2 commits into from Jun 5, 2019


None yet
4 participants
Copy link

commented Jun 3, 2019

What is the purpose of this pull request? (put an "X" next to item)

[X] Bug fix #11615

What changes did you make? (Give an overview)

This PR fixes RuleTester to fail the test case if autofix made syntax errors.


  • fixes some test cases that autofix made syntax errors.
  • fixes the side-effect that overrides RuleTester.describe and permanently in tests/lib/rule-tester/rule-tester.js. This side-effect had confused tests/lib/rules/*.js as using the stub functions to test rules.

I have noticed that errors property with a number allows syntax errors. Some of our tests depend on the behavior in order to use syntax error in rule's tests (E.g. tests/lib/rules/spaced-comment.js#L577-L589). I'm not sure if it's intentional, but I left it as is.

I wonder if we should deprecate the errors property with a number. It causes false negatives such as tests/lib/rules/complexity.js#L84.

Is there anything you'd like reviewers to focus on?

Nothing in particular.

mysticatea added some commits Jun 3, 2019

@mysticatea mysticatea changed the title Fix: fails the test case if autofix made syntax error (fixes #11615) Fix: fails the test case if autofix made syntax error (fixes #11615) Jun 3, 2019


g-plane approved these changes Jun 3, 2019

Copy link

left a comment

LGTM, thanks!

Copy link

left a comment

LGTM, thanks!

@mysticatea mysticatea merged commit 5509cdf into master Jun 5, 2019

5 checks passed

commit-message PR title follows commit message guidelines
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
licence/cla Contributor License Agreement is signed.
release-monitor No patch release is pending

@mysticatea mysticatea deleted the issue11615 branch Jun 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.