繁体   English   中英

标识符不是驼峰式的

[英]Identifier is not a camel case

我必须从模块导入,但出现错误 Identifier 'locale_en' is not in camel case。 我该怎么做才能解决这个问题。

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

我使用模块'react-intl'并尝试在我的规则中添加: camelcase: ["error", {properties: "never"}] ,但它仍然无法正常工作

编辑:我找到了解决方案:规则是: "camelcase": [1, {"properties": "never"}]

您现在可以灵活地allow某些标识符(也包括正则表达式)为非驼峰式:

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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