Fix upload pull requests#1010
Open
AlexImb wants to merge 1 commit into
Open
Conversation
- Fixed 323+ linting issues (went from 371 to 48 remaining) - Fixed unnecessary regex escape characters in all microlink services - Fixed hasOwnProperty access security issues - Added proper documentation for intentional empty base class methods - Fixed formatting issues across all files - All tests still passing (1057 tests) Remaining issues are mostly warnings about 'any' types and intentional empty test mocks.
There was a problem hiding this comment.
Pull Request Overview
This PR addresses various linting issues and code quality improvements across the codebase.
- Replaced
letand explicit type annotations withconstor inferred types where appropriate - Simplified regex character classes, updated example URLs and SVG icons in service classes
- Enhanced property definitions with JSDoc, improved
hasOwnPropertychecks, and cleaned up utility functions
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/services/local.test.ts | Switched let → const in tests |
| src/uppload.ts | Replaced let with const for firstService |
| src/services/microlink/weheartit.ts | Updated icon, color, exampleURL, and regex syntax |
| src/services/microlink/twitter.ts | Updated icon, exampleURL, and regex syntax |
| src/services/microlink/tumblr.ts | Updated icon, color, exampleURL, and regex syntax |
| src/services/microlink/reddit.ts | Updated icon, color, exampleURL, and regex syntax |
| src/services/microlink/pinterest.ts | Updated icon, color, exampleURL, and regex syntax |
| src/services/microlink/linkedin.ts | Updated icon, color, exampleURL, and regex syntax |
| src/services/microlink/instagram.ts | Simplified regex syntax |
| src/services/microlink/fotki.ts | Simplified regex syntax |
| src/services/microlink/flipboard.ts | Simplified regex syntax |
| src/services/microlink/flickr.ts | Simplified regex syntax |
| src/services/microlink/facebook.ts | Simplified regex syntax |
| src/services/microlink/deviantart.ts | Simplified regex syntax |
| src/services/microlink/artstation.ts | Simplified regex syntax |
| src/services/microlink/9gag.ts | Simplified regex syntax |
| src/services/local.ts | Removed redundant type annotation for maxFileSize |
| src/service.ts | Added JSDoc to base methods and removed explicit type syntax |
| src/i18n/fa.ts | Fixed indentation of a long string literal |
| src/helpers/utils.ts | Removed explicit type annotations for default parameters |
| src/helpers/i18n.ts | Replaced hasOwnProperty calls with safer Object.prototype |
| src/effects/flip/index.ts | Replaced let with const for file |
| src/effect.ts | Added JSDoc to base handler and removed explicit type syntax |
Comments suppressed due to low confidence (3)
src/services/microlink/weheartit.ts:9
- The updated regex for
validatorshould have accompanying unit tests to ensure URLs still validate correctly, especially after syntax simplification.
/(https?:\/\/(.+?\.)?weheartit\.com(\/[A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=]*)?)/.test(
tests/services/local.test.ts:39
- Using
const file = nullprevents reassignment, but the test expectsfileto be set byservice.dropHandler. Consider reverting toletor refactoring the handler to return the file instead of mutating this variable.
const file = null;
tests/services/local.test.ts:45
- Similarly here,
const file = nullcannot be updated byservice.getFile, soexpect(file).toBeDefined()will always fail. Useletor change the API to return the file.
const file = null;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix various linting issues to improve code quality and maintainability.