Skip to content

Commit e2987b7

Browse files
committed
chore: apply linter fixes and code formatting
- Remove extra semicolons from JSX code examples - Fix import formatting in test files - Apply consistent code style across components
1 parent 3b9c7a4 commit e2987b7

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

EXAMPLES.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,13 @@ php -S localhost:8080 -t examples # Using PHP
7171

7272
```tsx
7373
import { ReactQrCode } from '@devmehq/react-qr-code'
74-
7574
;<ReactQrCode value="https://example.com" size={256} />
7675
```
7776

7877
### With Custom Styling
7978

8079
```tsx
8180
import { AdvancedQRCode } from '@devmehq/react-qr-code'
82-
8381
;<AdvancedQRCode
8482
value="https://example.com"
8583
size={300}
@@ -117,7 +115,6 @@ import { AdvancedQRCode } from '@devmehq/react-qr-code'
117115

118116
```tsx
119117
import { AdvancedQRCode, QRHelpers } from '@devmehq/react-qr-code'
120-
121118
;<AdvancedQRCode
122119
value={QRHelpers.wifi('NetworkName', 'password123', 'WPA2')}
123120
theme="professional"

src/__tests__/AdvancedQRCode.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,11 @@ describe('AdvancedQRCode', () => {
303303
})
304304

305305
describe('Preset Themes', () => {
306-
Object.keys(PRESET_THEMES).forEach((theme) => {
306+
Object.keys(PRESET_THEMES).forEach((theme,i) => {
307307
it(`should apply ${theme} theme`, () => {
308308
const { container } = render(
309309
<AdvancedQRCode
310+
key={i}
310311
value="test"
311312
theme={theme as keyof typeof PRESET_THEMES}
312313
/>

src/components/AdvancedQRCode.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export const AdvancedQRCode = forwardRef<QRCodeRef, AdvancedQRCodeProps>(
238238
>
239239
{config.colors.map((stop, index) => (
240240
<stop
241-
key={index}
241+
key={`${id}-stop-${index}`}
242242
offset={`${stop.offset * 100}%`}
243243
stopColor={stop.color}
244244
stopOpacity={stop.opacity || 1}
@@ -256,7 +256,7 @@ export const AdvancedQRCode = forwardRef<QRCodeRef, AdvancedQRCodeProps>(
256256
>
257257
{config.colors.map((stop, index) => (
258258
<stop
259-
key={index}
259+
key={`${id}-stop-${index}`}
260260
offset={`${stop.offset * 100}%`}
261261
stopColor={stop.color}
262262
stopOpacity={stop.opacity || 1}
@@ -443,7 +443,7 @@ export const AdvancedQRCode = forwardRef<QRCodeRef, AdvancedQRCodeProps>(
443443
transform: scale(1);
444444
}
445445
}
446-
446+
447447
svg > * {
448448
animation: fadeIn ${animationDuration}ms ease-in-out ${animationDelay}ms forwards;
449449
}

src/components/shapes/EyeRenderer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export class EyeRenderer {
5858

5959
return (
6060
<g transform={transform}>
61-
{filters.length > 0 && <defs>{filters}</defs>}
61+
{filters.length > 0 && <defs>{filters.map((filter, index) => React.cloneElement(filter, { key: `${id}-filter-${index}` }))}</defs>}
6262

6363
{/* Outer Frame */}
6464
{this.renderFrame(

0 commit comments

Comments
 (0)