总是出错
`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`
Run Code Online (Sandbox Code Playgroud)
我尝试从页面 https://eslint.org/docs/2.0.0/rules/camelcase 添加到 .eslintrc.js 变体中的规则,但对我没有任何作用..:(
`rules: {
camelcase: ['error', {properties: 'always'}],
},
```
rules: {
camelcase: ['error', {allow: ['aa_bb']}],,
},`
Run Code Online (Sandbox Code Playgroud)
小智 6
如果你使用打字稿,你可以使用这个:
"rules": {
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variableLike", "format": ["snake_case", "camelCase"]
}
]
}
Run Code Online (Sandbox Code Playgroud)
这可能不是最好的选择,但至少对我有用。