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

Mention --fix bug in comment #35

Merged
merged 2 commits into from
Aug 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/rules/expect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ function validate(context: TSESLint.RuleContext<MessageIds, [Options]>, options:
let applied = false;
return {
range: [start, start],
// Trick: Function `fix` is ALWAYS run, and result is collected. However RuleFix objects are only read if `--fix` is passed
// Bug: previously, ESLint would only read RuleFix objects if `--fix` is passed. Now it seems to no matter what.
// TODO: See if we can only update snapshots if `--fix` is passed?
// See: https://github.com/JoshuaKGoldberg/eslint-plugin-expect-type/issues/14
get text() {
if (!applied) {
// Make sure we update snapshot only on first read of this object
Expand Down