Skip to content

Commit 10bc853

Browse files
committed
docs: update wording in consistent-output rule doc to reflect current relevance
1 parent 951d208 commit 10bc853

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/rules/consistent-output.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
✔️ The `"extends": "plugin:eslint-plugin/recommended"` property in a configuration file enables this rule.
44

5-
When writing tests for fixable rules, it's a best practice to use the `output` property on each test case to assert what autofixed code is produced, or to assert that no autofix is produced using `output: null`.
5+
When writing tests for fixable rules, the `output` property on each test case can be used to assert what autofixed code is produced, or to assert that no autofix is produced using `output: null`.
66

77
Prior to ESLint 7, it was easy to forget to assert the autofix output of a particular test case, resulting in incomplete test coverage and a greater chance of unexpected behavior / bugs.
88

9-
[As of ESLint 7](https://eslint.org/docs/user-guide/migrating-to-7.0.0#additional-validation-added-to-the-ruletester-class), test cases that trigger an autofix are required to provide the `output` property.
9+
[As of ESLint 7](https://eslint.org/docs/user-guide/migrating-to-7.0.0#additional-validation-added-to-the-ruletester-class), test cases that trigger an autofix are required by ESLint to provide the `output` property. Thus, it's now acceptable and more concise to omit this property when there's no autofix.
1010

1111
## Rule Details
1212

@@ -71,6 +71,8 @@ This rule takes an optional string enum option with one of the following values:
7171

7272
If you're not writing fixable rules, or you want to write test cases without output assertions, do not enable this rule.
7373

74+
As mentioned in the introduction, the need for this rule is reduced as of ESLint v7.
75+
7476
## Further Reading
7577

7678
* [`RuleTester` documentation](http://eslint.org/docs/developer-guide/working-with-plugins#testing)

0 commit comments

Comments
 (0)