-
-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails cops: referer vs referrer #1032
Comments
Isn't |
Haha, well technically speaking... https://en.wikipedia.org/wiki/HTTP_referer#Etymology |
Good to know! :-) |
@mockdeep, based on the wiki article, this is quite interesting. It appears that the misspelling has become the standard. It raises an interesting question of if |
@rrosenblum something tells me it isn't very consistently spelled anywhere, though I think we'd go with |
I could see it being a configurable cop, though, so people can pick their flavor. |
I was thinking the same things. |
Nice, thanks! |
Oh, the confusion: https://www.w3.org/TR/html5/links.html#link-type-noreferrer 😆
|
Old issue I know however, this one killed my flow 😂 a cop against something like this is imho, useless! and it wants the incorrect spelling of the word. The correct spelling is referrer ! |
I think not to check is the best practice... |
I still can't believe that a cop like this even exists. Rubocop is a great concept, but the devs are taking it way to far with this one 😜 |
@leewaa you know you can disable rules that aren't useful to you, right? You can also configure it to your preferred spelling. I've been happy with this rule. Having inconsistent spelling makes it harder to grep for references. |
Yes, configuration is a must since everyone runs their own coding style / conventions and the default doesn't suit everyones needs. I kinda get the reasoning to why this exists, however enforcing the incorrect spelling of a word per default is wrong 😄 |
@leewaa the reason it's enforcing a misspelling is because that is the way it is in the spec. There's nothing forcing you to do it that way in your codebase, but it's not "wrong" to follow the spec. It's perfectly reasonable to stick with the misspelling, since that's more consistent with most other places in the stack, including your browser. Take your pick, but to me its six of one and half a dozen of the other. It certainly doesn't seem worth fussing over one way or the other. |
Thanks for your time, appreciate it. I am already aware of the history, something I had looked into before commenting on this back in 2019. It's actually what makes this so much worse for me 🙈. Why are we still plagued to continue with incorrectly spelling the word, and then even enforcing it per default. I find this is moving in the wrong direction. Just because it's in the spec, doesn't mean we have to cover for that. We already accept either spelling in Anyway Ill stop here, as you said it's not really worth the fuss, though I do like healthy discussion. |
Rails supports both
request.referer
andrequest.referrer
, and after perusing our codebase we discovered that we're using both. It would be great to have a cop to enforce one or the other for the sake of consistency.The text was updated successfully, but these errors were encountered: