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
camelcase lint error on module import when deconstructing #6755
Comments
Hi @lordgiotto, thanks for reaching out! Just verified that this is true. Even without the So, to recap: Valid: /* eslint camelcase: 2*/
import { no_camel_case_prop as CamelCaseProp } from 'external-module'; Invalid: /* eslint camelcase: 2*/
import { no_camel_case_prop } from 'external-module'; Invalid: /* eslint camelcase: 2*/
import { no_camel_case_prop as no_camel_case_prop } from 'external-module'; @lordgiotto Would this be something you are willing to send a PR for? |
@lordgiotto The workaround you listed is wrong. It would be import * as externalModule from 'external-module';
externalModule.no_camel_case_prop; |
@michaelficarra Oh, sorry, you're right! I fix it now. @vitorbal It would be a pleasure, but to be honest I never read ESLint source code and I should at least study how it's designed before be able to send a PR. So I could do it, but i would need some time :P |
Calmecase rule now doesn't report an error if camelcased identifier is imported with a camecased alias. Otherwhise it reports an error as expected.
@vitorbal PR done :) |
Calmecase rule now doesn't report an error if camelcased identifier is imported with a camecased alias. Otherwhise it reports an error as expected.
Calmecase rule now doesn't report an error if camelcased identifier is imported with a camecased alias. Otherwhise it reports an error as expected.
Calmecase rule now doesn't report an error if camelcased identifier is imported with a camecased alias. Otherwhise it reports an error as expected.
Calmecase rule now doesn't report an error if camelcased identifier is imported with a camecased alias. Otherwhise it reports an error as expected.
Calmecase rule now doesn't report an error if camelcased identifier is imported with a camecased alias. Otherwhise it reports an error as expected.
Calmecase rule now doesn't report an error if camelcased identifier is imported with a camecased alias. Otherwhise it reports an error as expected.
ESLint version:
3.1.1
Rule:
"camelcase": [2, { "properties": "never" }]
Problem
Lint fails on module import when deconstructing properties and aliasing.
But with 186e8f0 that rule should ignore camelcase during deconstructing.
(I know that import deconstructing is not a real object deconstructing, but probably it should follow the same rule)
For now I have to workaround this issue this way:
Thank you :)
The text was updated successfully, but these errors were encountered: