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

chore: fix lint issues #857

Merged
merged 2 commits into from
Oct 14, 2021
Merged

chore: fix lint issues #857

merged 2 commits into from
Oct 14, 2021

Conversation

josephaxisa
Copy link
Contributor

No description provided.

(cherry picked from commit 908f43cd643cc83c5db87516a435344d0ffb0517)
(cherry picked from commit c938d077c620937a3f3a2d362e04f1c9de7b7633)
@google-cla google-cla bot added the cla: yes label Oct 14, 2021
@@ -184,6 +184,12 @@
]
},
"overrides": [
{
"files": ["packages/run-it/**/*.ts{,x}", "packages/api-explorer/**/*.ts{,x}", "packages/hackathon/**/*.ts{,x}"],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since we do not have tree shaking yet, the linter is wrong and I am disabling this rule across api-explorer, run-it and hackathon.

Copy link

Choose a reason for hiding this comment

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

It's worth noting that tree-shaking is live in the core product so it's likely this can get fixed across-the-board (I'd imagine in a future PR)

@josephaxisa josephaxisa requested review from jkaster, bryans99 and a user October 14, 2021 18:12
Copy link
Contributor

@jkaster jkaster left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link
Contributor

APIX Tests

    1 files  ±0    80 suites  ±0   3m 30s ⏱️ -1s
320 tests ±0  307 ✔️ ±0  13 💤 ±0  0 ❌ ±0 
336 runs  ±0  323 ✔️ ±0  13 💤 ±0  0 ❌ ±0 

Results for commit d0f90ef. ± Comparison against base commit 9a9d9fe.

@josephaxisa josephaxisa merged commit 55daf45 into main Oct 14, 2021
@josephaxisa josephaxisa deleted the jax/fix-lint-issues branch October 14, 2021 18:21
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

If "testing-library/prefer-screen-queries" is going to be disabled I think it'd be a good tech-debt ticket to log to eventually enable it (see inline comment specific to that).

The Object.assign for defaultProps should be replaced with the attrs function from Styled Components

@@ -184,6 +184,12 @@
]
},
"overrides": [
{
"files": ["packages/run-it/**/*.ts{,x}", "packages/api-explorer/**/*.ts{,x}", "packages/hackathon/**/*.ts{,x}"],
Copy link

Choose a reason for hiding this comment

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

It's worth noting that tree-shaking is live in the core product so it's likely this can get fixed across-the-board (I'd imagine in a future PR)

Comment on lines +34 to +39
export const MDHeading = Object.assign(styled(Heading)``, {
defaultProps: {
mb: 'xsmall',
pt: 'xsmall',
},
})
Copy link

Choose a reason for hiding this comment

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

Rather than leveraging defaultProps at use attrs

Suggested change
export const MDHeading = Object.assign(styled(Heading)``, {
defaultProps: {
mb: 'xsmall',
pt: 'xsmall',
},
})
export const MDHeading = styled(Heading).attrs(
({ mb = 'xsmall', pt = 'xsmall' }) => ({ px, py })``

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems like I missed your review by a few seconds. I will put up a fix for this fix

packages/code-editor/src/Markdown/common.tsx Show resolved Hide resolved
packages/code-editor/src/Markdown/common.tsx Show resolved Hide resolved
@@ -195,7 +201,8 @@
"rules": {
"testing-library/render-result-naming-convention": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/ban-ts-comment": "off"
"@typescript-eslint/ban-ts-comment": "off",
"testing-library/prefer-screen-queries": "off"
Copy link

Choose a reason for hiding this comment

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

I believe there's an auto-fix for this so it might be worth running with eslint --fix and seeing how many tests can get auto-fixed to use screen.

We have found that screen really helps test readability and solves for some common bugs around async behavior. Read-up at: https://kentcdodds.com/blog/common-mistakes-with-react-testing-library#not-using-screen

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree with this but @looker/redux is being copied as is from HT so we don't want to make any changes to it in this repo as it would be hard to maintain. We are using screen everywhere else that we control

@github-actions

This comment has been minimized.

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

Successfully merging this pull request may close these issues.

2 participants