node.js - 如何设置 ESLint 规则以接受snake_case?
问题描述
总是出错
`16:3 error Property name `type_array` must match one of the following formats: camelCase, UPPER_CASE, PascalCase @typescript-eslint/naming-convention
16:3 error Identifier 'type_array' is not in camel case
16:3 error Property name `instument_view_id` must match one of the following formats: camelCase, UPPER_CASE, PascalCase`
我尝试从页面 https://eslint.org/docs/2.0.0/rules/camelcase 添加到 .eslintrc.js 变体中的规则,但对我没有任何作用.. :(
`rules: {
camelcase: ['error', {properties: 'always'}],
},
```
rules: {
camelcase: ['error', {allow: ['aa_bb']}],,
},`
解决方案
ESLint 不支持snake_case
. 如果你想使用snake_case
,试试这个ESLint 插件。
推荐阅读
- tensorflow2.0 - ssd mobilenet v2 fpnlite_320x320 奇怪的行为
- android - 生成 UUID 以有效地用作 android 设备唯一 ID
- vb.net - 如何在 VB .net 中以编程方式修复字符串中的括号?
- android - 使用 Material Transitions 时启动 Activity 并完成上一个 Activity 会显示主屏幕(finishAfterTransition 不起作用)
- css - 如何使最后一个元素将粘性元素向上推
- android - 相机总是在 resultCode 中返回 0 并且在 onActivityResult 中返回不正确的数据,但仅在模拟器上
- javascript - 是/否 javascript 函数询问问题,即使它不应该
- continuous-integration - Drone CI 运行中的共享存储/缓存
- jar - 如何从 Jasypt 为 jar 文件之外的应用程序 yaml 声明 Encryptable Property Source 注释?
- sql-server - 如何使用 SQL Server 从 xml 获取嵌套对象列表?