Reports expressions concatenating strings with forward slash
config =
[ NoUrlStringConcatenation.rule
]
Fail
a =
baseUrl ++ "/items/" ++ itemId
Success
a =
Url.Builder.crossOrigin baseUrl [ "items", "itemId" ]
When (not) to enable this rule
This rule is useful when there are many expressions that build URL using string concatenation.
This rule is not useful when there are plenty of expressions concatenating non-url strings that contain forward slash.
Try it out
You can try this rule out by running the following command:
Reports expressions concatenating strings with forward slash
Fail
Success
When (not) to enable this rule
This rule is useful when there are many expressions that build URL using string concatenation. This rule is not useful when there are plenty of expressions concatenating non-url strings that contain forward slash.
Try it out
You can try this rule out by running the following command: