Skip to content
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

@typescript-eslint/naming-convention: add HTTP headers to ignorelist #44

Closed
jonahsnider opened this issue Oct 6, 2021 · 6 comments
Closed

Comments

@jonahsnider
Copy link

VS Code screenshot

HTTP headers and other common words (ex. POST or GET) should be added to an ignorelist so the camelcase validator doesn't trigger for them.

@sindresorhus
Copy link
Member

Does the rule have this ability?

@jonahsnider
Copy link
Author

You could add a RegExp to match words with the filter property. Messy but should work.

@sindresorhus
Copy link
Member

I don't think that's a good idea. It's messy and it will also make non-header properties with the same name not be linted.

@EdJoPaTo
Copy link

EdJoPaTo commented Oct 6, 2021

I think keys from other libraries should be allowed in general. Other libraries have their defined keys in options and so on and I cant those keys from this side.

Because of this I disabled this rule for most of my projects because two of my most used libraries have keys that are not written in the same way xo wants them to be. This results in hundreds of errors which made me prefer to just disable the rule at all. Which is sad as I like the idea of enforcing variable style.

@maxpain
Copy link

maxpain commented Jan 13, 2022

Any updates on this?

@jonahsnider
Copy link
Author

No, but luckily I've since changed my mind about header naming. Since Node.js & the HTTP spec say headers are case-insensitive I am now of the opinion that header names should instead be enforced to be totally lowercase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants