最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Identifier is not a camel case - Stack Overflow

programmeradmin2浏览0评论

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"}]

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"}]

Share Improve this question edited Sep 10, 2018 at 10:18 Monsieur Sam asked Sep 10, 2018 at 9:00 Monsieur SamMonsieur Sam 3331 gold badge7 silver badges20 bronze badges 6
  • camelcase is not a camel case but camelCase is. – Bhojendra Rauniyar Commented Sep 10, 2018 at 9:03
  • Definition for rule 'camelCase' was not found ... – Monsieur Sam Commented Sep 10, 2018 at 9:05
  • 3 Ironic that the camelcase rule's name is not in camel case. – T.J. Crowder Commented Sep 10, 2018 at 9:09
  • Have you tried aliasing? – user10340130 Commented Sep 10, 2018 at 9:27
  • What are you talking about aliasing ? @user10340130 – Monsieur Sam Commented Sep 10, 2018 at 9:28
 |  Show 1 more ment

1 Answer 1

Reset to default 5

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

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

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

发布评论

评论列表(0)

  1. 暂无评论