AOSSIE-Org / AOSSIE-Org/SocialShareButton

Remove or guard console.error statement in production build (src/social-share-button.js)

Đang mở
#43 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
25
Fork
65
Merge trung bình
2 ngày 11 giờ
Pull request đã merge (30 ngày)
1

Mô tả

## Code Quality Issue

**Source**: Identified during review of PR #36 (https://github.com/AOSSIE-Org/SocialShareButton/pull/36)
**Requested by**: @kpj2006

### Description
A `console.error` statement exists in `src/social-share-button.js` at line ~371 inside the clipboard fallback path. Console statements in production library code can pollute the browser console for end users and potentially leak internal error details.

### Location
**File**: `src/social-share-button.js`, line ~371

### Current code
```javascript
console.error('Fallback copy failed:', err);
```

### Recommended Fix

**Option 1 — Remove entirely** (preferred for a library):
```javascript
// Remove the console.error line
```

**Option 2 — Development-only guard**:
```javascript
if (typeof process !== 'undefined' && process.env && process.env.NODE_ENV !== 'production') {
console.error('Fallback copy failed:', err);
}
```

### Acceptance Criteria
- [ ] Verify no other unguarded `console.*` statements exist in `src/`
- [ ] Remove or conditionally guard the `console.error` call

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.