This repository was archived by the owner on Jun 24, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 148
feat(server): lint for trailing slashes in sync URL and extra slashes… #2345
Merged
Conversation
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
… in customRequestHandler
…ogic based on feedback
eliandoran
approved these changes
Jun 18, 2025
eliandoran
suggested changes
Jun 18, 2025
Contributor
eliandoran
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are type errors:
Error: src/routes/custom.ts(49,17): error TS2322: Type 'RegExpMatchArray | null' is not assignable to type 'null'.
Type 'RegExpMatchArray' is not assignable to type 'null'.
Error: src/routes/custom.ts(71,39): error TS2339: Property 'slice' does not exist on type 'never'.
Error: src/routes/custom.ts(49,17): error TS2322: Type 'RegExpMatchArray | null' is not assignable to type 'null'.
Type 'RegExpMatchArray' is not assignable to type 'null'.
Error: src/routes/custom.ts(71,39): error TS2339: Property 'slice' does not exist on type 'never'.
Error: src/services/utils.spec.ts(647,59): error TS2322: Type 'null' is not assignable to type 'string'.
Error: src/services/utils.spec.ts(648,69): error TS2322: Type 'undefined' is not assignable to type 'string'.
Error: src/services/utils.spec.ts(672,52): error TS2322: Type 'null' is not assignable to type 'string'.
Error: src/services/utils.spec.ts(673,62): error TS2322: Type 'undefined' is not assignable to type 'string'.
> tsc --build --emitDeclarationOnly
Error: src/routes/custom.ts(49,17): error TS2322: Type 'RegExpMatchArray | null' is not assignable to type 'null'.
Type 'RegExpMatchArray' is not assignable to type 'null'.
Error: src/routes/custom.ts(71,39): error TS2339: Property 'slice' does not exist on type 'never'.
Error: src/routes/custom.ts(49,17): error TS2322: Type 'RegExpMatchArray | null' is not assignable to type 'null'.
Type 'RegExpMatchArray' is not assignable to type 'null'.
Error: src/routes/custom.ts(71,39): error TS2339: Property 'slice' does not exist on type 'never'.
Error: src/services/utils.spec.ts(647,59): error TS2322: Type 'null' is not assignable to type 'string'.
Error: src/services/utils.spec.ts(648,69): error TS2322: Type 'undefined' is not assignable to type 'string'.
Error: src/services/utils.spec.ts(672,52): error TS2322: Type 'null' is not assignable to type 'string'.
Error: src/services/utils.spec.ts(673,62): error TS2322: Type 'undefined' is not assignable to type 'string'.
apps/server/src/routes/custom.ts
Outdated
Comment on lines
53
to
57
| } catch (e: unknown) { | ||
| const [errMessage, errStack] = safeExtractMessageAndStackFromError(e); | ||
| log.error(`Testing path for label '${attr.attributeId}', regex '${pattern}' failed with error: ${errMessage}, stack: ${errStack}`); | ||
| continue; | ||
| } |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what circumstances would a regex fail?
Member
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The log.error() would trigger I believe in the following scenarios:
- Invalid regex syntax in the attr.value (like unclosed brackets [abc, invalid quantifiers, etc.)
- Runtime errors during path.match() execution (though obviously "shouldn't happen")
Member
Author
|
Why is it that I always manage to break my local repo 😔 |
eliandoran
approved these changes
Jun 20, 2025
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
… in customRequestHandler