-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
chore(lint): Experimenting with more strict linting rules - If braces and no-unnecessary-condition #34054
Conversation
}); | ||
this._channel.on('pageError', ({ error, page }) => { | ||
const pageObject = Page.from(page); | ||
const parsedError = parseError(error); | ||
this.emit(Events.BrowserContext.WebError, new WebError(pageObject, parsedError)); | ||
if (pageObject) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to always be non-nullish. Should this check be re-added anyway?
} | ||
if (!browser.contexts()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how this would ever be falsy.
} | ||
if (!browser.contexts()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how this would ever be falsy again.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Test results for "tests 1"15 fatal errors, not part of any test |
I still see a bunch of curly around one-liners, is that from before or after our discussion? Also bots seem to be unhappy. |
As we were discussing internally, explore applying rules to make
if
s display the same whether they're single or multi-line (always with braces.Additionally adds the
@typescript-eslint/no-unnecessary-condition
rule to use TypeScript to evaluate whether or not certain comparisons are necessary. Anywhere flagged by this rule indicates either a logic or types error, which I believe we should all be committed on fixing.This PR is cleanly separated into commits for each set of major changes:
if
braces changes: b771466