AOSSIE-Org / AOSSIE-Org/SocialShareButton

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

Offen
#43 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
25
Forks
65
Ø Merge
2 T. 11 Std.
Gemergte PRs (30 T.)
1

Beschreibung

## 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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.