区域设置代码的驼峰式 ESLint 警告

ESLint warning in camelcase for locale code

我使用 ESLint 来提高我的代码质量,但我不需要它警告某些声明,例如区域设置代码 en_US

ESLint warning for camelcase rule

如果我在评论中添加一些配置就像the document告诉

/* eslint camelcase: ["error", "properties": ["never"]] */
import zh_TW from 'moment/locale/zh-tw';

ESLint 仍然警告驼峰问题。在这种情况下如何关闭警告?

我对配置行有疑问:

Doc says:
/* eslint camelcase: ["error", {properties: "never"}] */
But you did this:
/* eslint camelcase: ["error", "properties": ["never"]] */

(编辑:但它似乎没有什么不同(见评论)。问题一定出在其他地方)

此外,我不确定您是否收到@vahdet 的建议:

import { zh_TW as zhTw } from 'moment/locale/zh-tw';
               ^^^^^^^

然后您在代码中使用 zhTw 而不是 zh_TW,并且不需要排除 linter :)