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

tests(eslint): add export rule #13282

Merged
merged 11 commits into from
Nov 3, 2021
Merged

tests(eslint): add export rule #13282

merged 11 commits into from
Nov 3, 2021

Conversation

connorjclark
Copy link
Collaborator

Adds lint rules enforcing 1) no statements after an export and 2) at most one export statement in a file

@connorjclark connorjclark requested a review from a team as a code owner October 28, 2021 23:39
@connorjclark connorjclark requested review from adamraine and removed request for a team October 28, 2021 23:39
@google-cla google-cla bot added the cla: yes label Oct 28, 2021
@@ -12,11 +12,11 @@ import {getFilmstripFrames, getScreenDimensions, getFullPageScreenshot} from './

const ANIMATION_FRAME_DURATION_MS = 500;

export const Separator: FunctionComponent = () => {
const Separator: FunctionComponent = () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I forgot about flow report stuff. This is a big change for this code. @adamraine what are your thoughts on export style for component files?

We could always exclude tsx files if it's generally considered more idiomatic this way

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine, I'll probably get used to it

/**
* Report-renderer-specific strings.
*/
const UIStrings = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more in line with every other use of UIStrings, but to me this isn't worth breaking blame.

@paulirish
Copy link
Member

👍 to the rules. i find it easier to navigate this way.

@connorjclark
Copy link
Collaborator Author

connorjclark commented Nov 2, 2021

image

can't work out this TS error. @brendankenny thoughts? https://gist.github.com/connorjclark/20a7d2df46fbc440da83fbbc7f84d795

@brendankenny
Copy link
Member

one of the tsc projects is seeing into util.js when it couldn't before, and it doesn't have an LH.ReportResult defined in its globals

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants