Skip to content

Commit c899b17

Browse files
authored
Set react/jsx-key to warn (#7024)
1 parent 2c3e728 commit c899b17

File tree

8 files changed

+24
-18
lines changed

8 files changed

+24
-18
lines changed

.eslintrc.cjs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,6 @@ module.exports = {
5555
'codegen.cjs',
5656
'tsup',
5757
],
58-
// parserOptions: {
59-
// ecmaVersion: 2020,
60-
// sourceType: 'module',
61-
// project: ['./tsconfig.eslint.json'],
62-
// },
63-
// parser: '@typescript-eslint/parser',
64-
// plugins: [...guildConfig.plugins, 'hive'],
65-
// extends: guildConfig.extends,
6658
overrides: [
6759
{
6860
// Setup GraphQL Parser
@@ -87,6 +79,10 @@ module.exports = {
8779
'@graphql-eslint/no-deprecated': 'error',
8880
},
8981
},
82+
{
83+
files: ['*.cjs'],
84+
parserOptions: { ecmaVersion: 2020 },
85+
},
9086
{
9187
files: ['packages/**/*.ts', 'packages/**/*.tsx', 'cypress/**/*.ts', 'cypress/**/*.tsx'],
9288
reportUnusedDisableDirectives: true,
@@ -189,13 +185,14 @@ module.exports = {
189185
'import/no-default-export': 'off',
190186
'@next/next/no-img-element': 'off',
191187
'@typescript-eslint/ban-types': 'off',
192-
'react/jsx-key': 'off',
193188
'jsx-a11y/label-has-associated-control': 'off',
194189
'jsx-a11y/click-events-have-key-events': 'off',
195190
'jsx-a11y/no-static-element-interactions': 'off',
196191
'@next/next/no-html-link-for-pages': 'off',
197192
'unicorn/no-negated-condition': 'off',
198193
'no-implicit-coercion': 'off',
194+
195+
'react/jsx-key': 'warn',
199196
},
200197
},
201198
{

packages/web/app/src/components/organization/settings/oidc-integration-section.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ function OIDCMetadataFetcher(props: {
344344
metadataResult.error.formErrors.fieldErrors.userinfo_endpoint?.[0],
345345
]
346346
.filter(Boolean)
347-
.map(msg => (
348-
<p>{msg}</p>
347+
.map((msg, i) => (
348+
<p key={i}>{msg}</p>
349349
))}
350350
</>
351351
),

packages/web/app/src/pages/native-composition-diff.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,16 @@ export function NativeCompositionDiff(props: NativeCompositionDiffProps): ReactN
7171
<Tabs>
7272
<TabsList>
7373
{nativeFederationCompatibility.results.map((result, index) =>
74-
result ? <TabsTrigger value={String(index)}>Target {index}</TabsTrigger> : null,
74+
result ? (
75+
<TabsTrigger value={String(index)} key={index}>
76+
Target {index}
77+
</TabsTrigger>
78+
) : null,
7579
)}
7680
</TabsList>
7781
{nativeFederationCompatibility.results.map((result, index) =>
7882
result ? (
79-
<TabsContent value={String(index)}>
83+
<TabsContent value={String(index)} key={index}>
8084
<div>
8185
<div>Supergraph Diff</div>
8286
<div>
@@ -91,8 +95,8 @@ export function NativeCompositionDiff(props: NativeCompositionDiffProps): ReactN
9195
<div>
9296
{result.nativeCompositionResult.errors?.edges?.length ? (
9397
<ul>
94-
{result.nativeCompositionResult.errors.edges.map(edge => (
95-
<li>{edge.node.message}</li>
98+
{result.nativeCompositionResult.errors.edges.map((edge, i) => (
99+
<li key={i}>{edge.node.message}</li>
96100
))}
97101
</ul>
98102
) : (

packages/web/app/src/pages/target-app-version.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ function TargetAppVersionContent(props: {
227227
</TableRow>
228228
</TableHeader>
229229
<TableBody>
230-
{data.data?.target?.appDeployment.documents?.edges.map(edge => (
231-
<TableRow>
230+
{data.data?.target?.appDeployment.documents?.edges.map((edge, i) => (
231+
<TableRow key={i}>
232232
<TableCell>
233233
<span className="rounded bg-gray-800 p-1 font-mono text-sm">
234234
{edge.node.hash}

packages/web/app/src/pages/target-apps.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,9 @@ function TargetAppsView(props: {
295295
</TableRow>
296296
</TableHeader>
297297
<TableBody>
298-
{data.data?.target?.appDeployments?.edges.map(edge => (
298+
{data.data?.target?.appDeployments?.edges.map((edge, i) => (
299299
<AppTableRow
300+
key={i}
300301
organizationSlug={props.organizationSlug}
301302
projectSlug={props.projectSlug}
302303
targetSlug={props.targetSlug}

packages/web/docs/src/app/gateway/gateway-feature-tabs.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export function GatewayFeatureTabs(props: { className?: string }) {
5656
return (
5757
<FeatureTabs
5858
highlights={highlights}
59+
// eslint-disable-next-line react/jsx-key
5960
icons={[<PerformanceIcon />, <SecurityIcon />]}
6061
className={cn(
6162
'border-blue-200 [--tab-bg-dark:theme(colors.blue.300)] [--tab-bg:theme(colors.blue.200)]',

packages/web/docs/src/components/ecosystem-management/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export function EcosystemManagementSection({ className }: { className?: string }
2727
</Heading>
2828
<ul className="mx-auto flex list-none flex-col gap-y-4 text-white/80 lg:gap-y-6">
2929
{[
30+
// eslint-disable-next-line react/jsx-key
3031
<div className="text-white">
3132
A complete ecosystem covering all your dev and production needs.
3233
</div>,

packages/web/docs/src/components/pricing/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ export function Pricing({ className }: { className?: string }): ReactElement {
209209
icon={<OperationsIcon />}
210210
category="Operations per month"
211211
features={[
212+
// eslint-disable-next-line react/jsx-key
212213
<span>
213214
1M operations per month
214215
<small className="block text-xs">Then $10 per million operations</small>
@@ -296,6 +297,7 @@ export function Pricing({ className }: { className?: string }): ReactElement {
296297
features={[
297298
'Dedicated Slack channel for support',
298299
'White-glove onboarding',
300+
// eslint-disable-next-line react/jsx-key
299301
<span>
300302
GraphQL / APIs support and guidance from{' '}
301303
<TextLink href="https://theguild.dev">The&nbsp;Guild</TextLink>

0 commit comments

Comments
 (0)