AOSSIE-Org / AOSSIE-Org/SocialShareButton
Remove or guard console.error statement in production build (src/social-share-button.js)
- Lingua principale
- TypeScript
- Stelle
- 25
- Fork
- 65
- Merge medio
- 2g 11h
- PR unite (30g)
- 1
Descrizione
## 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
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.