Skip to content

Commit 3d6a40f

Browse files
authored
update lint config and dependencies, fix new warnings (#2412)
1 parent 15d86a0 commit 3d6a40f

15 files changed

Lines changed: 223 additions & 212 deletions

File tree

.oxlintrc.json

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"error",
3434
{
3535
"vars": "all",
36-
"args": "none",
3736
"ignoreRestSiblings": true,
3837
"caughtErrors": "all",
3938
"caughtErrorsIgnorePattern": "^_"
@@ -77,9 +76,12 @@
7776
"jsx-a11y/anchor-has-content": "error",
7877
"jsx-a11y/anchor-is-valid": "error",
7978
"jsx-a11y/aria-props": "error",
79+
"jsx-a11y/aria-role": "error",
8080
"jsx-a11y/heading-has-content": "error",
81+
"jsx-a11y/html-has-lang": "error",
8182
"jsx-a11y/img-redundant-alt": "error",
8283
"jsx-a11y/label-has-associated-control": "error",
84+
"jsx-a11y/no-aria-hidden-on-focusable": "error",
8385
"jsx-a11y/no-noninteractive-tabindex": "error",
8486
"jsx-a11y/no-redundant-roles": "error",
8587
"jsx-a11y/prefer-tag-over-role": "off",
@@ -107,8 +109,7 @@
107109
"nextjs/no-unwanted-polyfillio": "error",
108110
"promise/always-return": "error",
109111
"promise/no-callback-in-promise": "error",
110-
"react-hooks/rules-of-hooks": "error",
111-
"react/button-has-type": "error",
112+
"react/exhaustive-deps": "error",
112113
"react/forward-ref-uses-ref": "error",
113114
"react/jsx-boolean-value": ["error"],
114115
"react/jsx-curly-brace-presence": ["error"],
@@ -123,23 +124,27 @@
123124
],
124125
"react/jsx-no-duplicate-props": "error",
125126
"react/jsx-no-undef": "error",
127+
"react/jsx-no-useless-fragment": "error",
128+
"react/no-array-index-key": "error",
126129
"react/no-did-mount-set-state": "error",
127130
"react/no-direct-mutation-state": "error",
128131
"react/no-redundant-should-component-update": "error",
132+
"react/no-render-return-value": "error",
129133
"react/no-string-refs": "error",
130134
"react/no-this-in-sfc": "error",
131135
"react/no-unknown-property": "error",
132136
"react/no-unescaped-entities": "error",
133137
"react/no-will-update-set-state": "error",
138+
"react/rules-of-hooks": "error",
134139
"react/self-closing-comp": "error",
135-
"react/style-prop-object": "error",
140+
"react/void-dom-elements-no-children": "error",
136141
"typescript/await-thenable": "error",
137142
"typescript/ban-ts-comment": [
138143
"error",
139144
{
140145
"minimumDescriptionLength": 3,
141-
"ts-expect-error": "allow-with-description",
142146
"ts-check": false,
147+
"ts-expect-error": "allow-with-description",
143148
"ts-ignore": true,
144149
"ts-nocheck": true
145150
}
@@ -151,14 +156,20 @@
151156
"fixStyle": "inline-type-imports"
152157
}
153158
],
159+
"typescript/no-array-delete": "error",
154160
"typescript/no-confusing-non-null-assertion": "error",
155161
"typescript/no-confusing-void-expression": [
156162
"error",
157163
{
158164
"ignoreArrowShorthand": true
159165
}
160166
],
167+
"typescript/no-duplicate-type-constituents": "error",
161168
"typescript/no-extra-non-null-assertion": "error",
169+
"typescript/no-floating-promises": "error",
170+
"typescript/no-for-in-array": "error",
171+
"typescript/no-inferrable-types": "error",
172+
"typescript/no-meaningless-void-operator": "error",
162173
"typescript/no-misused-promises": [
163174
"error",
164175
{
@@ -167,6 +178,7 @@
167178
],
168179
"typescript/no-restricted-types": "error",
169180
"typescript/no-unnecessary-boolean-literal-compare": "error",
181+
"typescript/no-unnecessary-parameter-property-assignment": "error",
170182
"typescript/no-unnecessary-type-arguments": "error",
171183
"typescript/no-unnecessary-type-assertion": "error",
172184
"typescript/no-unnecessary-type-constraint": "error",

bun.lock

Lines changed: 52 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/Explore/ExploreSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ function renderLibs(list: LibraryType[]) {
6060
const now = Date.now();
6161
return list
6262
.filter(({ github }) => now - new Date(github.stats.updatedAt).getTime() < UPDATED_IN)
63-
.map((item: LibraryType, index: number) => (
63+
.map(item => (
6464
<LibraryWithLoading
65-
key={`explore-item-${index}-${item.github.name}`}
65+
key={`explore-item-${item.npmPkg}`}
6666
library={item}
6767
showTrendingMark
6868
skipMetadata

components/Home/HomeSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ export default function HomeSection({
7272
function renderLibs(list: LibraryType[], count: number) {
7373
return list
7474
.splice(0, count)
75-
.map((item: LibraryType, index: number) => (
75+
.map(item => (
7676
<LibraryWithLoading
77-
key={`home-item-${index}-${item.github.name}`}
77+
key={`home-item-${item.npmPkg}`}
7878
library={item}
7979
skipMetadata
8080
skipSecondaryMetadata

components/Libraries.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ export default function Libraries({ libraries }: Props) {
2121

2222
return (
2323
<View style={tw`pt-3`}>
24-
{libraries.map((item, index) => (
25-
<LibraryWithLoading key={`list-item-${index}-${item.github.name}`} library={item} />
24+
{libraries.map(item => (
25+
<LibraryWithLoading key={`list-item-${item.npmPkg}`} library={item} />
2626
))}
2727
</View>
2828
);

components/Library/DirectoryScore.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ export function DirectoryScore({ score, matchingScoreModifiers, sizeMultiplier =
7373
</strong>
7474
<br />
7575
<ul style={tw`m-0 pl-3.5 text-[12px]`}>
76-
{matchingScoreModifiers.map((mod, index) => (
77-
<li key={`mod-${index}`}>{mod}</li>
76+
{matchingScoreModifiers.map(mod => (
77+
<li key={`mod-${mod}`}>{mod}</li>
7878
))}
7979
</ul>
8080
</Tooltip>

components/Library/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ export default function Library({
129129
</View>
130130
{!skipMetadata && Platform.OS === 'web' && library.images && library.images.length > 0 && (
131131
<View style={tw`mt-2 flex-row flex-wrap items-center gap-x-0.5`}>
132-
{library.images.map((image, index) => (
133-
<Thumbnail key={`${image}-${index}`} url={image} />
132+
{library.images.map(image => (
133+
<Thumbnail key={image} url={image} />
134134
))}
135135
</View>
136136
)}

components/Package/MarkdownContentBox/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export default function MarkdownContentBox({ packageName, library, loader = fals
225225
isValidElement<{ href?: string }>(element) &&
226226
isGitHubVideoAssetLink(element.props.href)
227227
) {
228-
return <>{children}</>;
228+
return children;
229229
}
230230
}
231231

components/Package/NotFound.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { View } from 'react-native';
2+
13
import { P } from '~/common/styleguide';
24
import { Button } from '~/components/Button';
35
import ContentContainer from '~/components/ContentContainer';
@@ -10,7 +12,7 @@ export default function NotFound() {
1012
return (
1113
<>
1214
<PageMeta title="Error" description="Nothing was found! Go back to the directory home." />
13-
<Navigation header={<></>} />
15+
<Navigation header={<View />} />
1416
<ContentContainer>
1517
<NotFoundContent
1618
header="Nothing was found! Go back to the directory home."

0 commit comments

Comments
 (0)