简体   繁体   中英

Identifier is not a camel case

I have to import from a module and I have an error Identifier 'locale_en' is not in camel case. How can I do to resolve this.

import locale_en from 'react-intl/locale-data/en'

I use the module 'react-intl' and I try to add this : camelcase: ["error", {properties: "never"}] in my rules and it's still not working

Edit : I find the solution : the rules is : "camelcase": [1, {"properties": "never"}]

You can now flexibly allow certain identifiers (regexp also) to be non-camelcase:

{
    "rules": {
        "camelcase": ["error", {"allow": ["aa_bb"]}]
    }
}

See: https://eslint.org/docs/rules/camelcase#allow

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM