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

Set eslint-plugin/consistent-output lint rule to always require test case output assertions (internal only) #1629

Merged
merged 1 commit into from
Jan 27, 2020

Conversation

bmish
Copy link
Contributor

@bmish bmish commented Jan 26, 2020

Use the more strict option for this internal eslint-plugin/consistent-output lint rule. This will ensure that developers always assert what the autofixer output should be.

If a rule has no autofix, we should assert that there is no output. All of the test cases I fixed have no autofix, so the output matches the input. Once eslint v2 support is dropped, we can switch to output: null to represent this, and re-enable the eslint-plugin/prefer-output-null internal lint rule.

Since this change is internal-only, I have not added it to the changelog.

Follow-up to #1620.

…uire test case output assertions

Use the more strict option for this internal lint rule.

If a rule has no autofix, we should assert that there is no output. All of the test cases I fixed have no autofix, so the output matches the input. In eslint > v2, we can switch to `output: null` to represent this, and re-enable the `eslint-plugin/prefer-output-null` internal lint rule.

https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/consistent-output.md
https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/blob/master/docs/rules/prefer-output-null.md
@bmish bmish requested a review from ljharb January 26, 2020 18:58
@coveralls
Copy link

coveralls commented Jan 26, 2020

Coverage Status

Coverage remained the same at 97.837% when pulling 6274d96 on bmish:consistent-output-always into a4d301b on benmosher:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.837% when pulling b3fff46 on bmish:consistent-output-always into 2d42464 on benmosher:master.

5 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.837% when pulling b3fff46 on bmish:consistent-output-always into 2d42464 on benmosher:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.837% when pulling b3fff46 on bmish:consistent-output-always into 2d42464 on benmosher:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.837% when pulling b3fff46 on bmish:consistent-output-always into 2d42464 on benmosher:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.837% when pulling b3fff46 on bmish:consistent-output-always into 2d42464 on benmosher:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 97.837% when pulling b3fff46 on bmish:consistent-output-always into 2d42464 on benmosher:master.

@bmish
Copy link
Contributor Author

bmish commented Jan 26, 2020

Unfortunately, it looks like this change fails in eslint v2. I believe that's because eslint v2 does not support output: null.

We can reconsider this change when eslint v2 support is dropped.

@ljharb
Copy link
Member

ljharb commented Jan 26, 2020

@bmish does it support repeating the input as the output?

@bmish
Copy link
Contributor Author

bmish commented Jan 26, 2020

@ljharb good point, I switched to repeating the input as the output.

@ljharb ljharb merged commit 6274d96 into import-js:master Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants