-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Clean up all lint warnings #1199
Closed
+163
−87
Closed
Changes from 4 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
fcdb525
Clean up a few lint warnings
snowystinger 17d4031
Merge branch 'main' into clean-up-lint-warnings
snowystinger 629adfe
Merge branch 'main' into clean-up-lint-warnings
snowystinger fb1c9e4
Merge branch 'main' of https://github.com/adobe/react-spectrum into c…
LFDanLu cb01f26
fixing some lint warnings
LFDanLu 7656b73
more lint fixes
LFDanLu 0fa07a6
fixing new story lint
LFDanLu 4829591
Updating useOverlayPositon to not use dep array
LFDanLu e224f60
fixing rest of linter warnings
LFDanLu 31d731b
fixing table test
LFDanLu 2430934
Merge branch 'main' of https://github.com/adobe/react-spectrum into c…
LFDanLu afa543f
removing a whiteline
LFDanLu 4696ec4
Merge branch 'main' into clean-up-lint-warnings
LFDanLu 93e2f89
reverting lint max-level change
LFDanLu d6f3d79
Merge branch 'clean-up-lint-warnings' of https://github.com/adobe/rea…
LFDanLu 9ba8140
fix breadcrumb layouteffect dep array
LFDanLu 1d981ed
Merge branch 'main' of github.com:adobe/react-spectrum into clean-up-…
LFDanLu 5e501f8
Merge branch 'main' of github.com:adobe/react-spectrum into clean-up-…
LFDanLu c8440b1
Merge branch 'main' into clean-up-lint-warnings
snowystinger 874011a
Merge commit 'd04e70b27e40d0a04312d8c5e40127eceeefcd22' into clean-up…
snowystinger 2166816
Merge branch 'main' into clean-up-lint-warnings
snowystinger 2d273d0
Merge branch 'main' into clean-up-lint-warnings
snowystinger b4fa626
cleaning up more lint warnings
LFDanLu 0081d9f
Merge branch 'main' into clean-up-lint-warnings
LFDanLu 0d595fa
fix lint warnings
snowystinger ac9f2b4
Merge branch 'main' into clean-up-lint-warnings
snowystinger f21b763
Merge branch 'main' into clean-up-lint-warnings
LFDanLu ed616c4
Merge branch 'main' into clean-up-lint-warnings
snowystinger 57c3437
Merge branch 'main' into clean-up-lint-warnings
majornista 98ef135
Merge branch 'main' into clean-up-lint-warnings
majornista File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ | |
|
||
import {action} from '@storybook/addon-actions'; | ||
import {Breadcrumbs} from '../'; | ||
import {Button} from '@react-spectrum/button'; | ||
import {ButtonGroup} from '@react-spectrum/buttongroup'; | ||
// import {Heading} from '@react-spectrum/text'; | ||
import {Item} from '@react-stately/collections'; | ||
import React from 'react'; | ||
|
@@ -136,6 +138,10 @@ storiesOf('Breadcrumbs', module) | |
<Item>Root</Item> | ||
</Breadcrumbs> | ||
) | ||
) | ||
.add( | ||
ktabors marked this conversation as resolved.
Show resolved
Hide resolved
|
||
'adding breadcrumbs', | ||
() => <DynamicBreadcrumbs /> | ||
); | ||
|
||
function render(props = {}) { | ||
|
@@ -179,3 +185,44 @@ function renderMany(props = {}) { | |
</Breadcrumbs> | ||
); | ||
} | ||
|
||
let folders = [ | ||
{id: 1, label: 'Home'}, | ||
{id: 2, label: 'Trendy'}, | ||
{id: 3, label: 'March 2020 Assets'} | ||
]; | ||
|
||
let DynamicBreadcrumbs = () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For testing the above Breadcrumb dep array changes |
||
let [breadcrumbs, setBreadcrumbs] = React.useState(folders); | ||
let addBreadcrumb = () => { | ||
let newBreadcrumbs = [...breadcrumbs]; | ||
newBreadcrumbs.push({ | ||
id: breadcrumbs.length + 1, | ||
label: `Breadcrumb ${breadcrumbs.length + 1}` | ||
}); | ||
|
||
setBreadcrumbs(newBreadcrumbs); | ||
}; | ||
|
||
let removeBreadcrumb = () => { | ||
let newBreadcrumbs = [...breadcrumbs]; | ||
newBreadcrumbs.pop(); | ||
setBreadcrumbs(newBreadcrumbs); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<Breadcrumbs> | ||
{breadcrumbs.map(f => <Item key={f.id}>{f.label}</Item>)} | ||
</Breadcrumbs> | ||
<ButtonGroup marginEnd="30px"> | ||
<Button variant="secondary" onPress={() => addBreadcrumb()}> | ||
Add Breadcrumb | ||
</Button> | ||
<Button variant="secondary" onPress={() => removeBreadcrumb()}> | ||
Remove Breadcrumb | ||
</Button> | ||
</ButtonGroup> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Out of curiosity, is it just not checking in deps? or is deps actually missing some?
Lets add a comment when we // disable so that we know why we're ignoring it. It looks like you've started doing that a bit, so that's good. We should make sure every disable of this rule has an explanation
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.
For this one, the linter states " React Hook useCallback was passed a dependency list that is not an array literal" and I tried facebook/react#14476 (comment) w/ the JSON.stringify but it broke a lot of stuff so I opted for disabling it. I'll go ahead and put an explanation though, good idea
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.
actually, looking at it again maybe I can do away with the dep array since the useEffect below can have a dep on updatePosition